浏览代码

fix(webpack): ignore optional canvas dependency in resemblejs

Skipping node-canvas dependency in resemblejs as it [fails in certain environments](https://github.com/rsmbl/Resemble.js#nodejs).
The reference states

> If you are using Resemble.js for in-browser analysis only, you can skip the node-canvas dependency.
master
Werner Fleischer 3 年前
父节点
当前提交
a0aff63dde
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      webpack.config.js

+ 4
- 0
webpack.config.js 查看文件

@@ -294,6 +294,10 @@ module.exports = (_env, argv) => {
294 294
             plugins: [
295 295
                 ...config.plugins,
296 296
                 ...getBundleAnalyzerPlugin(analyzeBundle, 'app'),
297
+                new webpack.IgnorePlugin({
298
+                    resourceRegExp: /^canvas$/,
299
+                    contextRegExp: /resemblejs$/
300
+                }),
297 301
                 new webpack.IgnorePlugin({
298 302
                     resourceRegExp: /^\.\/locale$/,
299 303
                     contextRegExp: /moment$/

正在加载...
取消
保存