Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with Babel loader #10

Open
ischenkodv opened this issue Mar 2, 2016 · 2 comments
Open

Usage with Babel loader #10

ischenkodv opened this issue Mar 2, 2016 · 2 comments

Comments

@ischenkodv
Copy link

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.

@laurentpayot
Copy link

+1, same issue here.

@laurentpayot
Copy link

And by the way adding the map=linked-src option did the trick for me. Thanks @ischenkodv 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants