Skip to content

Commit eb3b7cf

Browse files
committed
fix($deps): upgrade deps and solve edge case when using contenthash during dev
1 parent 9e8fd10 commit eb3b7cf

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

index.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,6 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
285285
});
286286
}, function(err) {
287287
if(err) return callback(err);
288-
// REMOVING THIS CODE IS ALL THAT'S NEEDED TO CREATE CSS FILES PER CHUNK:
289-
// extractedChunks.forEach(function(extractedChunk) {
290-
// if(extractedChunk.isInitial())
291-
// this.mergeNonInitialChunks(extractedChunk);
292-
// }, this);
293-
// extractedChunks.forEach(function(extractedChunk) {
294-
// if(!extractedChunk.isInitial()) {
295-
// extractedChunk.modules.slice().forEach(function(module) {
296-
// extractedChunk.removeModule(module);
297-
// });
298-
// }
299-
// });
300288
compilation.applyPlugins("optimize-extracted-chunks", extractedChunks);
301289
callback();
302290
}.bind(this));
@@ -360,7 +348,8 @@ function getPath(compilation, source, chunk) {
360348
return compilation.getPath(format, {
361349
chunk: chunk
362350
}).replace(/\[(?:(\w+):)?contenthash(?::([a-z]+\d*))?(?::(\d+))?\]/ig, function() {
363-
return loaderUtils.getHashDigest(source, arguments[1], arguments[2], parseInt(arguments[3], 10));
351+
var sourceValue = source && source._value || source; // catch a small bug during development when using [contenthash]
352+
return loaderUtils.getHashDigest(sourceValue, arguments[1], arguments[2], parseInt(arguments[3], 10));
364353
});
365354
}
366355
}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
"webpack": "^2.2.0"
3030
},
3131
"dependencies": {
32-
"ajv": "^4.11.2",
33-
"async": "^2.1.2",
34-
"jsesc": "^2.5.1",
35-
"loader-utils": "^1.0.2",
32+
"ajv": "4.11.2",
33+
"async": "^2.5.0",
34+
"loader-utils": "^1.1.0",
3635
"schema-utils": "^0.3.0",
3736
"style-loader": "^0.18.2",
3837
"webpack-sources": "^1.0.1"

yarn.lock

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ ajv-keywords@^1.1.1:
7171
version "1.5.1"
7272
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
7373

74-
ajv@^4.11.2, ajv@^4.7.0, ajv@^4.9.1:
74+
ajv@4.11.2:
75+
version "4.11.2"
76+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.2.tgz#f166c3c11cbc6cb9dcc102a5bcfe5b72c95287e6"
77+
dependencies:
78+
co "^4.6.0"
79+
json-stable-stringify "^1.0.1"
80+
81+
ajv@^4.7.0, ajv@^4.9.1:
7582
version "4.11.7"
7683
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48"
7784
dependencies:
@@ -226,6 +233,12 @@ async@^2.0.1, async@^2.1.2:
226233
dependencies:
227234
lodash "^4.14.0"
228235

236+
async@^2.5.0:
237+
version "2.5.0"
238+
resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d"
239+
dependencies:
240+
lodash "^4.14.0"
241+
229242
async@~0.9.0:
230243
version "0.9.2"
231244
resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
@@ -2064,10 +2077,6 @@ jsbn@~0.1.0:
20642077
version "0.1.1"
20652078
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
20662079

2067-
jsesc@^2.5.1:
2068-
version "2.5.1"
2069-
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe"
2070-
20712080
jsesc@~0.5.0:
20722081
version "0.5.0"
20732082
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
@@ -2181,7 +2190,7 @@ loader-utils@^0.2.16:
21812190
json5 "^0.5.0"
21822191
object-assign "^4.0.1"
21832192

2184-
loader-utils@^1.0.2:
2193+
loader-utils@^1.0.2, loader-utils@^1.1.0:
21852194
version "1.1.0"
21862195
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
21872196
dependencies:

0 commit comments

Comments
 (0)