Browse Source

Pull request #3005: 无JIRA任务 更新loader

Merge in VISUAL/fineui from ~TELLER/fineui:master to master

* commit '35ebf877448e975aaab0e49ef316c7557b00a7c0':
  chore: 去除worker中css less的引用
  chore: 更新loader
es6
Teller 2 years ago
parent
commit
5af3b76036
  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