hustcc / hustcc/alimask

兼容webpack4.0

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
174
Forks
42
PR merge metrics
No merged PRs in 30d

Description

ERROR in ./node_modules/_alimask@1.0.3@alimask/dist/alimask.min.js
Module not found: Error: Can't resolve 'canvas' in '/Users/v/Work/tests/mcrm/node_modules/_alimask@1.0.3@alimask/dist'
@ ./node_modules/_alimask@1.0.3@alimask/dist/alimask.min.js 27:16-40
@ ./components/water-mask/index.js
...
ℹ 「wdm」: Failed to compile.

升级到webpack4+后, 会报上述错误, 查了一下, 在src/alimask.js里做如下改动即可解决这个问题:
line 56:
var Canvas = module.require('canvas'); => var Canvas = eval("module.require('canvas')");
如果有时间麻烦改下, thx

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/alimask.js at line 56 and reproduce the reported webpack 4+ build failure involving alimask.min.js and the unresolved canvas module. Verify the compatibility change there, then confirm the water-mask component compiles successfully under webpack 4+.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.