Answer the question
In order to leave comments, you need to log in
Why is webpack-dev-server not building code?
When you run the command, webpack
everything works correctly, the files are placed in dist.
When you run the command, the webpack-dev-server
folder is cleared thanks to the plugin CleanWebpackPlugin
, but it is not recompiled. Where can there be a mistake?
const path = require('path')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
module.exports = {
mode: 'development',
entry: ['./src/index.ts'],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/dist'
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'@core': path.resolve(__dirname, 'src/core')
}
},
// devtool: 'source-map',
devServer: {
port: 3000,
hot: true
},
plugins: [
new CleanWebpackPlugin()
]
}
Answer the question
In order to leave comments, you need to log in
Why is webpack-dev-server not building code?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question