Browse Source

Merge pull request #149613 in DEC/fineui from master to feature/x

* commit '5af3b76036243f4a35e41a6ea788fcf32133bfb7':
  chore: 去除worker中css less的引用
  chore: 更新loader
research/test
superman 2 years ago
parent
commit
857355b8b2
  1. 0
      plugins/webpack-fui-worker-plugin/empty.js
  2. 16
      plugins/webpack-fui-worker-plugin/worker-loader.js

0
plugins/webpack-fui-worker-plugin/empty.js

16
plugins/webpack-fui-worker-plugin/worker-loader.js

@ -67,6 +67,22 @@ function loader() {
entryOnly: true, entryOnly: true,
}).apply(childCompiler); }).apply(childCompiler);
// 去除源码中的less css引用
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}`; const subCache = `subcache ${__dirname} ${workerEntry}`;
childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => {
if (compilation.cache) { if (compilation.cache) {

Loading…
Cancel
Save