Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

437
Views
(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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!