livescript-loader
livescript-loader copied to clipboard
Usage with Babel loader
I use LiveScript loader with babel loader this way:
{ test: /\.ls$/, loader: 'babel?presets[]=react,presets[]=es2015!livescript' },
This configuration throws an exception:
ERROR in ./client/web/public/app.ls
Module build failed: TypeError: /home/dima/myapp/client/web/public/app.ls: Cannot assign to read only property 'mappings' of {"version":3,"sources":["/home/dima/myapp/client/web/public/app.ls"],"names":[],"mappings":";AACA,QAAQ,wBAAD;AAGP,QAAQ,gBAAA;AACR,KAAM,CAAA,... etc.
The problem is that it includes source maps to the output and Babel fails to transpile it. In the end I fixed it by adding map option:
{ test: /\.ls$/, loader: 'babel?presets[]=react,presets[]=es2015!livescript?map=linked-src' },
Should the map=linked-src be default option? Or maybe some note should be added to README.
+1, same issue here.
And by the way adding the map=linked-src option did the trick for me. Thanks @ischenkodv 👍