I'm having relatively simple webpack config file (below):
module.exports = {
entry: "./src/main.js",
output: {
filename: "bundle.js"
},
devtool: "eval",
module: {
loaders: [
{
test: /\.css$/, loader: "style!css",
exclude: /node_modules/,
},
{
test : /.js$/,
loader : 'babel-loader' ,
exclude: /node_modules/
}
]
}
};
I'm using webpack-dev-server
to serve an app when in development with the following mand webpack-dev-server --inline --hot --port 9090 --content-base public/ --watch
.
I read that it's remended using eval
for source maps when in development, but it doesn't work for me. What I get in my devtools is as follows. It correctly shows files (main.js
and hello.js
) but it contains babel-transpiled content, not the original one. When I set it to eval-source-map
it works fine.
What's wrong in my setup? Complete project for this question is available here
I'm having relatively simple webpack config file (below):
module.exports = {
entry: "./src/main.js",
output: {
filename: "bundle.js"
},
devtool: "eval",
module: {
loaders: [
{
test: /\.css$/, loader: "style!css",
exclude: /node_modules/,
},
{
test : /.js$/,
loader : 'babel-loader' ,
exclude: /node_modules/
}
]
}
};
I'm using webpack-dev-server
to serve an app when in development with the following mand webpack-dev-server --inline --hot --port 9090 --content-base public/ --watch
.
I read that it's remended using eval
for source maps when in development, but it doesn't work for me. What I get in my devtools is as follows. It correctly shows files (main.js
and hello.js
) but it contains babel-transpiled content, not the original one. When I set it to eval-source-map
it works fine.
What's wrong in my setup? Complete project for this question is available here
Share Improve this question edited Sep 18, 2015 at 8:07 Michal Ostruszka asked Sep 18, 2015 at 7:30 Michal OstruszkaMichal Ostruszka 2,0992 gold badges21 silver badges24 bronze badges1 Answer
Reset to default 5Please check official Webpack documentation for details of every Source Maps setting - http://webpack.github.io/docs/configuration.html#devtool.
If you want original lines (not transpiled) use options listed in documentation table.
| Devtool | Quality |
| ----------------------------- | ---------------------------- |
| cheap-module-eval-source-map | original source (lines only) |
| ----------------------------- | ---------------------------- |
| cheap-module-source-map | original source (lines only) |
| ----------------------------- | ---------------------------- |
| eval-source-map | original source |
| ----------------------------- | ---------------------------- |
| source-map | original source |