Skip to content

Commit

Permalink
Test watching modules included in a ConcatenatedModule
Browse files Browse the repository at this point in the history
ModuleConcatenationPlugin creates a ConcatenatedModule from harmony
modules. It must be rebuilt when those modules change.
  • Loading branch information
mzgoddard committed Jun 23, 2017
1 parent 9ea40f0 commit 3d6fe2c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 0 deletions.
@@ -0,0 +1 @@
export default 'This ';
@@ -0,0 +1,5 @@
import a from './a';
import b from './b';
import c from './c';

export default a + b + c;
@@ -0,0 +1 @@
export default 'is only';
@@ -0,0 +1 @@
export default ' a test';
@@ -0,0 +1 @@
module.exports = require('../bar/abc').default + '.0';
13 changes: 13 additions & 0 deletions test/watchCases/plugins/module-concatenation-plugin/0/index.js
@@ -0,0 +1,13 @@
it("should watch for changes", function() {
if(WATCH_STEP === '0') {
require("./foo/" + WATCH_STEP).should.be.eql('This is only a test.' + WATCH_STEP);
}
else if(WATCH_STEP === '1') {
require("./foo/" + WATCH_STEP).should.be.eql('This should be a test.' + WATCH_STEP);
}
else if(WATCH_STEP === '2') {
require("./foo/" + WATCH_STEP).should.be.eql('This should be working.' + WATCH_STEP);
}

STATS_JSON.modules.length.should.equal(4 + Number(WATCH_STEP));
});
@@ -0,0 +1 @@
export default 'should be';
@@ -0,0 +1 @@
module.exports = require('../bar/abc').default + '.1';
@@ -0,0 +1 @@
export default ' working';
@@ -0,0 +1 @@
module.exports = require('../bar/abc').default + '.2';
@@ -0,0 +1,6 @@
var webpack = require("../../../../");
module.exports = {
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
};

0 comments on commit 3d6fe2c

Please sign in to comment.