Skip to content

Commit 8e56785

Browse files
authored
fix: pass rootContext to loaders (#104)
1 parent 77a4ff2 commit 8e56785

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function pitch() {
3232
minimize: this.minimize,
3333
resourceQuery: this.resourceQuery,
3434
optionsContext: this.rootContext || this.options.context,
35+
rootContext: this.rootContext,
3536
},
3637
(err, r) => {
3738
if (r) {

src/worker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
187187
target: data.target,
188188
minimize: data.minimize,
189189
resourceQuery: data.resourceQuery,
190+
rootContext: data.rootContext,
190191
},
191192
},
192193
(err, lrResult) => {

test/sass-loader-example/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ module.exports = (env) => {
1414
workerParallelJobs: 2,
1515
poolTimeout: env.watch ? Infinity : 2000,
1616
};
17+
const sassLoaderOptions = {
18+
sourceMap: true,
19+
};
1720
if (+env.threads > 0) {
1821
threadLoader.warmup(workerPool, ['babel-loader', 'babel-preset-env']);
1922
threadLoader.warmup(workerPoolSass, ['sass-loader', 'css-loader']);
@@ -47,7 +50,7 @@ module.exports = (env) => {
4750
options: workerPoolSass,
4851
},
4952
'css-loader',
50-
'sass-loader',
53+
{ loader: 'sass-loader', options: sassLoaderOptions },
5154
].filter(Boolean),
5255
},
5356
],

0 commit comments

Comments
 (0)