Skip to content

Usage with Babel loader #10

Description

@ischenkodv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions