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

Source Maps are not the original source #1772

Closed
ddaza opened this issue Aug 30, 2017 · 4 comments
Closed

Source Maps are not the original source #1772

ddaza opened this issue Aug 30, 2017 · 4 comments

Comments

@ddaza
Copy link

ddaza commented Aug 30, 2017

with this config

// project/.storybook/webpack.config.js
module.exports = {
  plugins: [
    // your custom plugins
  ],
  devtool: 'inline-source-map',  // <-- source-map config is ignored
  resolve: {
    extensions: ['.js', '.jsx']
  },
  module: {
    rules: [
      {
        test: /\.j(s|sx)$/,
        exclude: /(node_modules)/,
        loader: 'babel-loader'
      },
      {
        test: /\.json$/,
        loader: 'json'
      },
      {
        test: /\.css$/,
        loaders: [
          'style-loader',
          'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
          {
            loader: 'postcss-loader',
            options: {
              plugins: (loader) => [
                require('postcss-import')({ root: loader.resourcePath }),
                require('postcss-cssnext')({browsers: ['last 2 versions', '> 5%']})
              ]
            }
          }
        ]
      }
    ]
  },
};

Running :

 $ start-storybook -p 6006 -c .storybook

I am seeing the transpilled source on my devtools:
image

@danielduan
Copy link
Member

Do you have a project somewhere on Github that we can take a look? I'm not seeing it in mine when I add that line, they all have the correct source map.

@ddaza
Copy link
Author

ddaza commented Aug 31, 2017

Sorry guys it was a .babelrc config I totally had missed. Thanks guys!

@ddaza ddaza closed this as completed Aug 31, 2017
@eddiemonge
Copy link
Contributor

Can you explain that? What fixed it?

@ddaza
Copy link
Author

ddaza commented Sep 21, 2017

My .babelrc had a devtool: source-maps config as well. Somehow having both they were cancelling each other. I removed the one on my .babelrc and everything worked.

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

No branches or pull requests

3 participants