Skip to content

Commit

Permalink
fix: support hot (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Sep 17, 2024
1 parent 102eddc commit 2de3b64
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function pitch() {
minimize: this.minimize,
optionsContext: this.rootContext || this.options.context,
rootContext: this.rootContext,
hot: this.hot,
},
(err, r) => {
if (r) {
Expand Down
1 change: 1 addition & 0 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
resourceFragment: data.resourceFragment,
environment: data.environment,
rootContext: data.rootContext,
hot: data.hot,
// eslint-disable-next-line no-underscore-dangle
_compilation: data._compilation,
// eslint-disable-next-line no-underscore-dangle
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/webpack.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exports[`Works with test-loader: result 1`] = `
"getMissingDependenciesResult": [],
"getOptions": "function",
"getResolve": "function",
"hot": true,
"importModule": "function",
"importModuleResult1": {
"default": "http://test.com/first/777312cffc01c1457868.less",
Expand Down
3 changes: 3 additions & 0 deletions test/basic-loader-test/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');

const webpack = require('webpack');

const threadLoader = require('../../dist'); // eslint-disable-line import/no-extraneous-dependencies

module.exports = (env) => {
Expand Down Expand Up @@ -39,5 +41,6 @@ module.exports = (env) => {
},
],
},
plugins: [new webpack.HotModuleReplacementPlugin()],
};
};

0 comments on commit 2de3b64

Please sign in to comment.