webpack-dev-server被编译但没有创建输出文件?

时间:2019-05-31 20:11:31

标签: javascript webpack

webpack-dev-server is getting compiled but not creating any output file while using simple webpack it is creating the file . why?

    const path = require("path");

    module.exports = {
      entry: "./src/app.js",
      output: {
        path: path.join(__dirname, "/public/"), //file path name
        filename: "bundles.js" //this is not getting created
      },
      module: {
        rules: [
          {
            test: /\.jsx?$/,
            exclude: /node_ modules/,
            loader: "babel-loader" //loader
          }
        ]
      },
      devtool: "cheap-module-eval-source-map",
      devServer: {
        contentBase: path.join(__dirname, 'public'),
        compress: true,
        port: 9000
      }
    };

它应该创建bundle.js 并且它没有给出任何编译时错误,也表明它可以成功编译。

1 个答案:

答案 0 :(得分:0)