appedemic / livescript-loader

livescript loader for webpack
19 stars 17 forks source link

Sourcemaps not properly provided to WebPack #7

Closed legomind closed 8 years ago

legomind commented 9 years ago

When chaining a "sourcemap aware" loader after livescript-loader, an error is thrown because livescript-loader does not emit a proper source map object

Error

read property 'match' of undefined
    at urlParse (/Users/coryt/projects/my-test-project/node_modules/source-map/lib/util.js:33:21)
    at normalize (/Users/coryt/projects/my-test-project/node_modules/source-map/lib/util.js:82:15)
    at Array.map (native)
    at SourceMapConsumer.BasicSourceMapConsumer (/Users/coryt/projects/my-test-project/node_modules/source-map/lib/source-map-consumer.js:308:8)
    at new SourceMapConsumer (/Users/coryt/projects/my-test-project/node_modules/source-map/lib/source-map-consumer.js:22:9)
    at File.mergeSourceMap (/Users/coryt/projects/my-test-project/node_modules/babel-core/lib/transformation/file/index.js:511:31)
    at File.generate (/Users/coryt/projects/my-test-project/node_modules/babel-core/lib/transformation/file/index.js:808:25)
    at File.transform (/Users/coryt/projects/my-test-project/node_modules/babel-core/lib/transformation/file/index.js:625:17)
    at /Users/coryt/projects/my-test-project/node_modules/babel-core/lib/transformation/pipeline.js:168:19
    at File.wrap (/Users/coryt/projects/my-test-project/node_modules/babel-core/lib/transformation/file/index.js:639:16)

WebPack config:

config =
  module:
      loaders: [
        * test: /\.ls$/
          loaders: [ 'babel-loader', 'livescript-loader' ]
          exclude: /node_modules/
          include: __dirname
      ]