isparta-loader icon indicating copy to clipboard operation
isparta-loader copied to clipboard

feat: adding sourcemap support

Open mwinche opened this issue 8 years ago • 5 comments

mwinche avatar May 09 '16 21:05 mwinche

This should close https://github.com/deepsweet/isparta-loader/issues/1

mwinche avatar May 09 '16 21:05 mwinche

👍

tennisgent avatar May 31 '16 20:05 tennisgent

Thank you very much man! Unfortunately the source map fix doesn't work for me. When starting the unit test I get:

Module build failed: TypeError: Cannot read property 'sections' of undefined
    at new SourceMapConsumer (<projectPath>/node_modules/source-map/lib/source-map-consumer.js:20:19)
    at Object.module.exports (<projectPath>/node_modules/isparta-loader/index.js:34:29)

The map from the exported function is undefined.

In the webpack config I use:

config.devtool = 'inline-source-map';

and initialize with:

config.module = {
    preLoaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'babel',
    }, {
      test: /\.js$/,
      include: [path.resolve(__dirname, '../../src')],
      loader: 'isparta',
    }],
    loaders: [],
  };

Is there something more to configure?

tchock avatar Jun 01 '16 07:06 tchock

I'll take a look, there shouldn't be much config. I just applied what I've seen other loaders do to support source maps and tested it for me locally.

mwinche avatar Jun 01 '16 19:06 mwinche

+1

gurghet avatar Nov 30 '16 11:11 gurghet