Browse Source

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

* commit 'b84d6fa74435c638269dc8136f852415be5a05a2':
  chore: 修改loader
research/test
superman 2 years ago
parent
commit
a30ce1a58c
  1. 6
      plugins/webpack-fui-worker-plugin/worker-loader.js

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

@ -115,16 +115,18 @@ function loader() {
null,
// 插入代码的转译和压缩由主构建配置的 babel/ts loader 处理, 不需要 worker-worker 来处理
// 添加 @ts-nocheck 避免 ts-check 报错
// 修复export const 下 const不会被转译的问题
`// @ts-nocheck
const blob = new Blob([${JSON.stringify(compilation.assets[entry].source())}]);
export const workerUrl = window.URL.createObjectURL(blob);
const workerUrl = window.URL.createObjectURL(blob);
export default workerUrl;
`
)
: callback(
null,
`// @ts-nocheck
const servicePath = __webpack_public_path__ + ${JSON.stringify(entry)};
export const workerUrl = servicePath;
export default servicePath;
`
)
});

Loading…
Cancel
Save