Questions tagged [webpack-dev-server]

a Node.js based server that supports live reloading and is used for development of webpack powered applications.

webpack-dev-server is a little Node.js Express server, which uses the webpack-dev-middleware to serve a webpack bundle. It also has a little runtime which is connected to the server via Socket.IO. The server emits information about the compilation state to the client, which reacts to those events by updating the bundle.

The server is used for development purpose only.

3256 questions
1
vote
0 answers

Webpack dev server hot module replacement working on .js files but not working on .html file updates

My package.json file looks like: { scripts": { "start": "webpack-dev-server" }, "author": "Mak Alamin", "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", "body-parser": "^1.19.0", "express": "^4.17.1", …
Mak Alamin
  • 144
  • 2
  • 7
1
vote
0 answers

js and css file path are not loaded by webpack5 when used with pug

I'm using pug and scss with webpack 5. I have kept main.js and main.css both bundled by webpack but still the path is not resolved tried specific js path in src folder but same thing, they are not loading. structure is…
1
vote
1 answer

Webpack cannot find dist/style.css

Using webpack-dev-server, I'm able to load ./dist/index.html at the root path (0.0.0.0:8080) and to view ./dist/bundle.js at 0.0.0.0:8080/bundle.js. I'm getting a 404 when I try to load (0.0.0.0:8080/style.css). The CSS in my ./dist directory is…
Ari Lacenski
  • 631
  • 12
  • 18
1
vote
1 answer

Getting error in console Uncaught ReferenceError: arguments is not defined after upgrading the webpack 4 to webpack 5

Getting error in console Uncaught ReferenceError: arguments is not defined after upgrading the webpack 4 to webpack 5. This arguments is in debounce funtion
1
vote
0 answers

HSTS preventing me from hitting local dev angular server with Firefox

I have just started using angular via webpack to bring up a client webserver via "serve": { "builder": "@angular-builders/custom-webpack:dev-server", "options": { "browserTarget":…
DavidA
  • 3,984
  • 5
  • 25
  • 38
1
vote
0 answers

How to configure 'crypto-random-string' in Angular 12 without compilation errors?

I am currently working on a migration project which I need to convert from Angular 6 to Angular 12. The updates went well, and ended up with a single library issue 'crypto-random-string'. So I created a blank project to test the crypto-random-string…
1
vote
0 answers

Vite: Configure webpack-dev-server like functionality in Vite

In webpack I could do something like to this to handle some development middleware code, which includes doing some work/testing inside the app.get call. devServer: { before: function (app, server) { app.get ("/", function (req, resp,…
GoldenRam
  • 11
  • 4
1
vote
1 answer

Webpack5 is unable to compile images while is running and raise an error

I am using webpack5 config to run a react repository and everything seems to be working fine except loading images, I have an error that I do not understand: ERROR in ./src/assets/styles/main.scss Module build failed (from…
mcmwhfy
  • 1,654
  • 5
  • 36
  • 58
1
vote
1 answer

Webpack generator https://createapp.dev/ fail starting the project

I have found this website which basically is generating a very nice webpack/babel boilerplate structure the problem is that I have some errors when I am trying to run the boilerplate that I do not understand: > empty-project@1.0.0 start…
mcmwhfy
  • 1,654
  • 5
  • 36
  • 58
1
vote
0 answers

Vaadin into Angular v1.x with through Webpack bundle

I am trying to bundle Vaadin in a single file to be loaded inside my portal (which running with AngularJS V1.x) following this guide. It fails because is using an old configuration (which I fixed for the development mode but I didn't for the…
Micky
  • 647
  • 1
  • 11
  • 26
1
vote
0 answers

How can I use webpack-dev-server for React embeded in AngularJs directives?

I'm working on a project with AngularJS which is progressively being migrated to React, so for now we are using React on AngularJS directives. The problem is that for every small change I need to run a npm run build ("build": "webpack --mode ") Is…
Hekkel
  • 31
  • 1
1
vote
1 answer

webpack serve not started

I can not run webpack serve. My configs: //webpack.config.js const webpack = require('webpack') const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const { CleanWebpackPlugin } =…
Vlad Kn
  • 141
  • 2
  • 13
1
vote
2 answers

Cannot GET / - localhost 8080 not working with webpack dev server

I have been following this tutorial online: https://www.youtube.com/watch?v=TOb1c39m64A. I am about 10 minutes in, where we are starting the webpack dev server for the first time. I do this and when I travel to: http://localhost:8080/ I receive a…
user16612582
1
vote
0 answers

Import a text file with Webpack

I'm a game that has text file levels. You can require JSON files, I'd like to do the same with text. const levels = [ require("./levels/1.txt"), require("./levels/2.txt"), require("./levels/3.txt") ];
Lucien
  • 776
  • 3
  • 12
  • 40
1
vote
1 answer

HtmlWebpackPlugin throwing TypeError: Cannot read property 'hash' of undefined after updating to Webpack5

I'm updating the libraries in our web app to the latest thus pushing Webpack up to Webpack5. When adjusting the parameters for 'webpack.config.dev.js' I keep running into the following error during…