Browse Source

chore: 修改loader

es6
iapyang 2 years ago
parent
commit
9d8ef216d6
  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