Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

446
Vistas
(node js) webpack-dev-server is not compiling correctly

I have a simple webpack, webpack-cli and webpack-dev-server project in Node going. My JS gets compiled from src/ to dist/js/ just fine when using npx webpack, but something weird is going on when I use npx webpack serve: I get the usual webpack 5.64.0 compiled successfully in 89 ms messages when I make changes to the javascript in the src/ folder, and the live server reloads, but no changes are actually made to the dist 'main.js' file. Not even with a hard refresh or a dev server restart. Here is my package.json...

{
  "name": "fate-clone",
  "version": "1.0.0",
  "scripts": {
    "start": "webpack serve --mode=development",
    "build": "webpack"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "pixi.js": "^6.2.0", //Just a WebGL graphics engine
    "webpack": "^5.64.0"
  },
  "devDependencies": {
    "webpack-cli": "^4.9.1",
    "webpack-dev-server": "^4.5.0"
  }
}

And my webpack.config.js...

const path = require('path')

module.exports = {
  stats: 'minimal',
  entry: path.join(__dirname, "src/index.js"),
  watch: true,
  output: {
    filename: 'main.js',
    path: path.join(__dirname, 'dist/js'),
  },
  devServer: {
    hot: true,
    compress: true,
    static:  {
      directory: path.join(__dirname, 'dist'),
    },
    port: 8080,
  }
}

Again, having 'npx webpack' running with watch=true compiles everything perfectly, so I'm confused what I'm missing that's causing webpack-dev-server to be compiling some mystery main.js file.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda