fonteditor-core icon indicating copy to clipboard operation
fonteditor-core copied to clipboard

webpack打包报错

Open ZeeLyn opened this issue 3 years ago • 2 comments

`These dependencies were not found:

  • env in ./node_modules/fonteditor-core/woff2/woff2.wasm
  • global in ./node_modules/fonteditor-core/woff2/woff2.wasm`

webpack打包报错

ZeeLyn avatar Nov 23 '22 08:11 ZeeLyn

在 webpack 上打包时,需要自己拷贝 woff2.wasm,然后 初始化时传入 下载地址:

woff2.init(wasmUrl).then(() => {
  // read
  let font = Font.create(buffer, {
    type: 'woff2'
  });
  // write
  font.write({type: 'woff2'});
});

kekee000 avatar Jan 06 '23 03:01 kekee000

是在编译的时候就报错,能否给一个示例

ZeeLyn avatar Apr 21 '23 11:04 ZeeLyn