Skip to content

Commit

Permalink
fix($deps): upgrade deps and solve edge case when using contenthash d…
Browse files Browse the repository at this point in the history
…uring dev
  • Loading branch information
faceyspacey committed Jul 17, 2017
1 parent 9e8fd10 commit eb3b7cf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
15 changes: 2 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,6 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
});
}, function(err) {
if(err) return callback(err);
// REMOVING THIS CODE IS ALL THAT'S NEEDED TO CREATE CSS FILES PER CHUNK:
// extractedChunks.forEach(function(extractedChunk) {
// if(extractedChunk.isInitial())
// this.mergeNonInitialChunks(extractedChunk);
// }, this);
// extractedChunks.forEach(function(extractedChunk) {
// if(!extractedChunk.isInitial()) {
// extractedChunk.modules.slice().forEach(function(module) {
// extractedChunk.removeModule(module);
// });
// }
// });
compilation.applyPlugins("optimize-extracted-chunks", extractedChunks);
callback();
}.bind(this));
Expand Down Expand Up @@ -360,7 +348,8 @@ function getPath(compilation, source, chunk) {
return compilation.getPath(format, {
chunk: chunk
}).replace(/\[(?:(\w+):)?contenthash(?::([a-z]+\d*))?(?::(\d+))?\]/ig, function() {
return loaderUtils.getHashDigest(source, arguments[1], arguments[2], parseInt(arguments[3], 10));
var sourceValue = source && source._value || source; // catch a small bug during development when using [contenthash]
return loaderUtils.getHashDigest(sourceValue, arguments[1], arguments[2], parseInt(arguments[3], 10));
});
}
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"webpack": "^2.2.0"
},
"dependencies": {
"ajv": "^4.11.2",
"async": "^2.1.2",
"jsesc": "^2.5.1",
"loader-utils": "^1.0.2",
"ajv": "4.11.2",
"async": "^2.5.0",
"loader-utils": "^1.1.0",
"schema-utils": "^0.3.0",
"style-loader": "^0.18.2",
"webpack-sources": "^1.0.1"
Expand Down
21 changes: 15 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ ajv-keywords@^1.1.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"

ajv@^4.11.2, ajv@^4.7.0, ajv@^4.9.1:
ajv@4.11.2:
version "4.11.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.2.tgz#f166c3c11cbc6cb9dcc102a5bcfe5b72c95287e6"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"

ajv@^4.7.0, ajv@^4.9.1:
version "4.11.7"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48"
dependencies:
Expand Down Expand Up @@ -226,6 +233,12 @@ async@^2.0.1, async@^2.1.2:
dependencies:
lodash "^4.14.0"

async@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d"
dependencies:
lodash "^4.14.0"

async@~0.9.0:
version "0.9.2"
resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
Expand Down Expand Up @@ -2064,10 +2077,6 @@ jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"

jsesc@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe"

jsesc@~0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
Expand Down Expand Up @@ -2181,7 +2190,7 @@ loader-utils@^0.2.16:
json5 "^0.5.0"
object-assign "^4.0.1"

loader-utils@^1.0.2:
loader-utils@^1.0.2, loader-utils@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
dependencies:
Expand Down

0 comments on commit eb3b7cf

Please sign in to comment.