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 并且它没有给出任何编译时错误,也表明它可以成功编译。
答案 0 :(得分:0)
有一个名为writeToDisk
的选项
https://webpack.js.org/configuration/dev-server/#devserverwritetodisk-