|
|
|
@ -68,9 +68,20 @@ function loader() {
|
|
|
|
|
}).apply(childCompiler); |
|
|
|
|
|
|
|
|
|
// 去除源码中的less css引用
|
|
|
|
|
new webpack.IgnorePlugin({ |
|
|
|
|
resourceRegExp: /\.(css|less)$/, |
|
|
|
|
}).apply(childCompiler); |
|
|
|
|
const regExp = /\.(css|less)$/; |
|
|
|
|
|
|
|
|
|
new webpack.NormalModuleReplacementPlugin( |
|
|
|
|
regExp, |
|
|
|
|
result => { |
|
|
|
|
if (regExp.test(result.request)) { |
|
|
|
|
result.request = resolve(__dirname, './empty.js'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (regExp.test(result.resource)) { |
|
|
|
|
result.resource = resolve(__dirname, './empty.js'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
).apply(childCompiler); |
|
|
|
|
|
|
|
|
|
const subCache = `subcache ${__dirname} ${workerEntry}`; |
|
|
|
|
childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { |
|
|
|
|