Answer the question
In order to leave comments, you need to log in
How to use source-map-loader?
Added source-map-loader to the project, but the chrome console still shows errors in the bundle, and not in a separate script.
webpack.config.js
module.exports = {
context: __dirname + "/src",
entry: "./index",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
watch:true,
devtool:"source-map",
module: {
loaders: [
{
test: /.js?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}
]
}
}
Answer the question
In order to leave comments, you need to log in
Most likely, you do not have the download of the generated source-map in chrome enabled, you can see how to enable it here: https://gist.github.com/jakebellacera/336c4982194b...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question