Skip to content

Commit

Permalink
fix: pass rootContext to loaders (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
qnighy authored Oct 27, 2020
1 parent 77a4ff2 commit 8e56785
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function pitch() {
minimize: this.minimize,
resourceQuery: this.resourceQuery,
optionsContext: this.rootContext || this.options.context,
rootContext: this.rootContext,
},
(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 @@ -187,6 +187,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
target: data.target,
minimize: data.minimize,
resourceQuery: data.resourceQuery,
rootContext: data.rootContext,
},
},
(err, lrResult) => {
Expand Down
5 changes: 4 additions & 1 deletion test/sass-loader-example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = (env) => {
workerParallelJobs: 2,
poolTimeout: env.watch ? Infinity : 2000,
};
const sassLoaderOptions = {
sourceMap: true,
};
if (+env.threads > 0) {
threadLoader.warmup(workerPool, ['babel-loader', 'babel-preset-env']);
threadLoader.warmup(workerPoolSass, ['sass-loader', 'css-loader']);
Expand Down Expand Up @@ -47,7 +50,7 @@ module.exports = (env) => {
options: workerPoolSass,
},
'css-loader',
'sass-loader',
{ loader: 'sass-loader', options: sassLoaderOptions },
].filter(Boolean),
},
],
Expand Down

0 comments on commit 8e56785

Please sign in to comment.