extract-text-webpack-plugin
Advanced tools
Comparing version 0.3.3 to 0.3.4
14
index.js
@@ -27,3 +27,2 @@ /* | ||
this.id = id; | ||
this.modulesByIdentifier = {}; | ||
} | ||
@@ -96,2 +95,3 @@ module.exports = ExtractTextPlugin; | ||
compiler.plugin("this-compilation", function(compilation) { | ||
var extractCompilation = new ExtractTextPluginCompilation(); | ||
compilation.plugin("normal-module-loader", function(loaderContext, module) { | ||
@@ -163,3 +163,3 @@ loaderContext[__dirname] = function(content, opt) { | ||
if(meta.content) | ||
this.addResultToChunk(module.identifier(), meta.content, extractedChunk); | ||
extractCompilation.addResultToChunk(module.identifier(), meta.content, extractedChunk); | ||
callback(); | ||
@@ -169,3 +169,3 @@ }.bind(this)); | ||
if(meta.content) | ||
this.addResultToChunk(module.identifier(), meta.content, extractedChunk); | ||
extractCompilation.addResultToChunk(module.identifier(), meta.content, extractedChunk); | ||
callback(); | ||
@@ -208,2 +208,6 @@ } | ||
function ExtractTextPluginCompilation() { | ||
this.modulesByIdentifier = {}; | ||
} | ||
ExtractTextPlugin.prototype.mergeNonInitialChunks = function(chunk, intoChunk, checkedChunks) { | ||
@@ -230,3 +234,3 @@ if(!intoChunk) { | ||
ExtractTextPlugin.prototype.addModule = function(identifier, source, additionalInformation, sourceMap) { | ||
ExtractTextPluginCompilation.prototype.addModule = function(identifier, source, additionalInformation, sourceMap) { | ||
if(!this.modulesByIdentifier[identifier]) | ||
@@ -237,3 +241,3 @@ return this.modulesByIdentifier[identifier] = new ExtractedModule(identifier, source, sourceMap, additionalInformation); | ||
ExtractTextPlugin.prototype.addResultToChunk = function(identifier, result, extractedChunk) { | ||
ExtractTextPluginCompilation.prototype.addResultToChunk = function(identifier, result, extractedChunk) { | ||
if(!Array.isArray(result)) { | ||
@@ -240,0 +244,0 @@ result = [[identifier, result]]; |
{ | ||
"name": "extract-text-webpack-plugin", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Extract text from bundle into a file.", |
@@ -44,3 +44,6 @@ # extract text plugin for webpack | ||
* `id` Unique ident for this plugin instance. (For advanded usage only) | ||
* `filename` the filename of the result file. May contain `[name]`. | ||
* `filename` the filename of the result file. May contain `[name]`, `[id]` and `[contenthash]`. | ||
* `[name]` the name of the chunk | ||
* `[id]` the number of the chunk | ||
* `[contenthash]` a hash of the content of the extracted file | ||
* `options` | ||
@@ -47,0 +50,0 @@ * `allChunks` extract all chunks (by default only initial chunks) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16907
384
68