Open tensory opened 2 years ago
@tensory
Hi, I faced the same issue for Webpack 5, and I solved it by using https://github.com/ThomasOrlita/Snap.svg-cjs. No need to use imports-loader
.
Just import Snap from "snapsvg-cjs";
This can be solved without having to switch to a different project using the solution in https://github.com/adobe-webplatform/Snap.svg/issues/639
I'm using Webpack
5.45.1
andimports-loader
3.0.0
.The suggestion in the Readme to use
imports-loader
with an argumentuse: "imports-loader?this=>window,fix=>module.exports=0"
is not compatible with latestimports-loader
.I was able to get the bundle file to build using this rule, updated using imports-loader 3.0.0 docs:
I would love to contribute this update as a pull request to the Readme. Unfortunately I'm still getting an error at runtime about
Uncaught ReferenceError: eve is not defined
, so it didn't solve the underlying problem that I thought the rule might address.