Answer the question
In order to leave comments, you need to log in
Why doesn't webpack-dev-server rebuild the project?
This is the webpack config
var path = require('path')
const dev = process.env.NODE_ENV !== "production"
module.exports = {
mode: dev ? "development" : "production",
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'public/dist'),
filename: 'bundle.js',
publicPath: 'dist/'
},
devServer: {
overlay: true,
contentBase: path.join(__dirname, '/public'),
historyApiFallback: true,
port: 3333,
},
module: {
rules: [
{
test: /\.js$/,
use: [
{ loader: "babel-loader" }
]
},
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" }
]
}
]
}
}
"scripts": {
"dev": "webpack-dev-server",
"start": "npm run dev"
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question