|
|
@ -68,9 +68,20 @@ function loader() { |
|
|
|
}).apply(childCompiler); |
|
|
|
}).apply(childCompiler); |
|
|
|
|
|
|
|
|
|
|
|
// 去除源码中的less css引用
|
|
|
|
// 去除源码中的less css引用
|
|
|
|
new webpack.IgnorePlugin({ |
|
|
|
const regExp = /\.(css|less)$/; |
|
|
|
resourceRegExp: /\.(css|less)$/, |
|
|
|
|
|
|
|
}).apply(childCompiler); |
|
|
|
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}`; |
|
|
|
const subCache = `subcache ${__dirname} ${workerEntry}`; |
|
|
|
childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { |
|
|
|
childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { |
|
|
|