webpack 配置 devtool

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_36422236/article/details/80735287

在开发环境中我们使用:cheap-module-eval-source-map

module.exports = {
  devtool: 'cheap-module-eval-source-map',
  entry: __dirname + "/app/main.js", //已多次提及的唯一入口文件
  output: {
    path: __dirname + "/public", //打包后的文件存放的地方
    filename: "bundle.js" //打包后输出文件的文件名
  }
}

在生产环境中我们使用:cheap-module-source-map。

module.exports = {
  devtool: 'cheap-module-source-map',
  entry: __dirname + "/app/main.js", //已多次提及的唯一入口文件
  output: {
    path: __dirname + "/public", //打包后的文件存放的地方
    filename: "bundle.js" //打包后输出文件的文件名
  }
}

猜你喜欢

转载自blog.csdn.net/sinat_36422236/article/details/80735287
今日推荐