Skip to content

Commit 09ac8cb

Browse files
committed
adjusted tests, remove module from base if extracted
1 parent 1791796 commit 09ac8cb

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
274274
if(meta && (!meta.options.id || meta.options.id === id)) {
275275
var wasExtracted = Array.isArray(meta.content);
276276
if(shouldExtract !== wasExtracted) {
277+
if (shouldExtract) {
278+
chunk.removeModule(module);
279+
return callback();
280+
}
277281
module[NS + "/extract"] = shouldExtract; // eslint-disable-line no-path-concat
278282
compilation.rebuildModule(module, function(err) {
279283
if(err) {

test/cases/multiple-entries-async/expected/0.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ webpackJsonp([0],{
33
/***/ 2:
44
/***/ (function(module, exports, __webpack_require__) {
55

6-
__webpack_require__(7);
6+
__webpack_require__(9);
7+
8+
modules.export = function() {
9+
return 'Route Homepage';
10+
};
711

812

913
/***/ }),
1014

11-
/***/ 7:
15+
/***/ 9:
1216
/***/ (function(module, exports) {
1317

1418
module.exports = "styles-homepage\n"

test/cases/multiple-entries-async/expected/1.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ webpackJsonp([1],{
33
/***/ 1:
44
/***/ (function(module, exports, __webpack_require__) {
55

6-
__webpack_require__(6);
6+
__webpack_require__(8);
7+
8+
modules.export = function() {
9+
return 'Route Contact';
10+
};
711

812

913
/***/ }),
1014

11-
/***/ 6:
15+
/***/ 8:
1216
/***/ (function(module, exports) {
1317

1418
module.exports = "styles-contact\n"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
require('./styles.txt');
2+
3+
modules.export = function() {
4+
return 'Route Contact';
5+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
require('./styles.txt');
2+
3+
modules.export = function() {
4+
return 'Route Homepage';
5+
};

0 commit comments

Comments
 (0)