我目前的webpack.config
文件
module.exports = {
entry: "./entry.js",
output: {
devtoolLineToLine: true,
sourceMapFilename: "./bundle.js.map",
pathinfo: true,
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" }
]
},
};
我正在阅读这里的内容https://webpack.github.io/docs/configuration.html,并找到以下内容:
output.sourceMapFilename
[file]将被替换为JavaScript文件的文件名。 [id]将被替换为块的ID。 [hash]将被替换为编译的哈希值。我已经像你看到的那样添加了它,但当我的webpack watch运行时,我没有看到地图文件?
这是如何完成的?
webpack -d --watch
起作用了,配置工具在我使用这个命令之前没有做任何事情。 - Leon Gaban-d
选项只是一个快捷方式,其中包括devtool
选项。配置选项应该与webpack --watch
一起工作。 - dreyescat