Skip to content

Commit 2de3b64

Browse files
fix: support hot (#219)
1 parent 102eddc commit 2de3b64

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function pitch() {
5959
minimize: this.minimize,
6060
optionsContext: this.rootContext || this.options.context,
6161
rootContext: this.rootContext,
62+
hot: this.hot,
6263
},
6364
(err, r) => {
6465
if (r) {

src/worker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
373373
resourceFragment: data.resourceFragment,
374374
environment: data.environment,
375375
rootContext: data.rootContext,
376+
hot: data.hot,
376377
// eslint-disable-next-line no-underscore-dangle
377378
_compilation: data._compilation,
378379
// eslint-disable-next-line no-underscore-dangle

test/__snapshots__/webpack.test.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ exports[`Works with test-loader: result 1`] = `
4848
"getMissingDependenciesResult": [],
4949
"getOptions": "function",
5050
"getResolve": "function",
51+
"hot": true,
5152
"importModule": "function",
5253
"importModuleResult1": {
5354
"default": "http://test.com/first/777312cffc01c1457868.less",

test/basic-loader-test/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const path = require('path');
22

3+
const webpack = require('webpack');
4+
35
const threadLoader = require('../../dist'); // eslint-disable-line import/no-extraneous-dependencies
46

57
module.exports = (env) => {
@@ -39,5 +41,6 @@ module.exports = (env) => {
3941
},
4042
],
4143
},
44+
plugins: [new webpack.HotModuleReplacementPlugin()],
4245
};
4346
};

0 commit comments

Comments
 (0)