3

Snap svg is quite new to me, I have followed the setup mentioned in the https://github.com/adobe-webplatform/Snap.svg. (webpack setup) But I'm getting "Uncaught ReferenceError: eve is not defined".

So I ended up using "const Snap = require(imports-loader?this=>window,fix=>module.exports=0!snapsvg/dist/snap.svg.js);" for production, but this not working for the unit test.

Error is from this lineeve = function (name, scope) { in "snap.svg.js".

satheesh
  • 403
  • 5
  • 15

1 Answers1

0

This is more like a webpack config setup issue:

{
    test: require.resolve('snapsvg/dist/snap.svg.js'),
    use: 'imports-loader?this=>window,fix=>module.exports=0',
}

These lines should be at top of the rules(first element of the rules array) in webpack config module object.

JiBéDoublevé
  • 4,124
  • 4
  • 36
  • 57
satheesh
  • 403
  • 5
  • 15