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
19
votes
3 answers

How to suppress warnings using webpack and post css

How do I suppress warnings generated by webpack loading post css files? Warning example: WARNING in ./~/css-loader!./~/postcss-loader!./src/components/Navigator/Navigator.css postcss-custom-properties:…
Avi Zloof
  • 2,923
  • 4
  • 22
  • 28
19
votes
9 answers

How can I stop webpack dev server from windows console?

I run webpack-dev-server from windows console with the command: webpack-dev-server --content-base ./build --inline --hot after this I see message webpack: bundle is now VALID. and I can't type anything there. But if I change something in…
Rajab Shakirov
  • 7,265
  • 7
  • 28
  • 42
19
votes
4 answers

Can I add cookies to a webpack dev server proxy?

I'm trying to set up a proxy within my webpack dev server. The issue is that I don't control the server I'm connecting to, and I need to authenticate the request. Is there a way I can add cookies on to the request I send to the proxy server? I've…
fnsjdnfksjdb
  • 1,653
  • 5
  • 19
  • 33
19
votes
3 answers

Can't get webpack hot module replacement to work

I've set up WebPack successfully - it's compiling my babel and SCSS files just fine, and I got the watch functionality to work fine. But I'd also like to work with the Hot Module Replacement - and I'm having difficulties getting it going. When I…
Alastair
  • 5,894
  • 7
  • 34
  • 61
18
votes
2 answers

Webpack DevServer -> proxy HTTPS resource -> UNABLE_TO_VERIFY_LEAF_SIGNATURE

I'm using Webpack DevServer with the following settings: devServer: { proxy: { '*': { target: 'https://localhost:44369', secure: true } }, port: 8080, host: '0.0.0.0', hot: true, https:…
Ogglas
  • 62,132
  • 37
  • 328
  • 418
18
votes
2 answers

WebPack sourcemaps confusing (duplicated files)

I decided to try out WebPack on a new project I'm spinning up today and I'm getting really strange behavior from the sourcemaps. I can't find anything about it in the documentation, nor can I find anyone else having this issue when skimming…
stevendesu
  • 15,753
  • 22
  • 105
  • 182
18
votes
2 answers

Error: EACCES: permission denied using webpack

I'm attempting to use webpack for the first time and I'm getting this error, Error: EACCES: permission denied, mkdir '/dist' at Error (native) when trying to run my production script. A sudo chown -R 'whoami' /dist came back with chown: /dist:…
CalAlt
  • 1,683
  • 2
  • 15
  • 29
18
votes
6 answers

Enabling webpack hot-reload in a docker application

I have a docker app with the following containers node - source code of the project. it serves up the html page situated in the public folder. webpack - watches files in the node container and updates the public folder (from the node container) on…
Jayaram
  • 6,276
  • 12
  • 42
  • 78
18
votes
2 answers

webpack+angular2 error: Uncaught ReferenceError: __decorate is not defined

chrome console error: Uncaught ReferenceError: __decorate is not defined this is code https://github.com/Dreampie/angular2-demo run it: npm install npm run typings install npm run start open localhost:80 in browser someone help?
Dreampie
  • 1,321
  • 4
  • 17
  • 32
18
votes
6 answers

Error `window not defined` in Node.js

I know window doesn't exist in Node.js, but I'm using React and the same code on both client and server. Any method I use to check if window exists nets me: Uncaught ReferenceError: window is not defined How do I get around the fact that I can't…
Kevin Ghadyani
  • 6,829
  • 6
  • 44
  • 62
17
votes
4 answers

How can I develop locally using a domain name instead of 'localhost:3000' in the url with create-react-app?

I have been developing a small app with create-react-app and a few other libraries i added. Given the planned architecture and some tests i'd like to run with react-router, i would like to be able to run my app locally using a domain mame in the…
xunux
  • 1,531
  • 5
  • 20
  • 33
17
votes
4 answers

React nested route fails to load on refresh

I have a React app with navigation powered by react-router that I run in development with webpack-dev-server and the history fallback option enabled. Here is the routes I have defined in my index.js ReactDOM.render((
Ucodia
  • 7,410
  • 11
  • 47
  • 81
17
votes
4 answers

How to use gulp webpack-stream to generate a proper named file?

Currently we're using Webpack for our Module loader, and Gulp for everything else (sass -> css, and the dev/production build process) I want to wrap the webpack stuff into gulp, so all I have to do is type gulp and it starts, watches and runs…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
17
votes
1 answer

Can I use webpack on the client side without nodejs server?

I am trying to build a web app where I want to store all html, js and css files on amazon s3, and communicate with a restful server through api. I am trying to achieve lazy loading and maybe routing with react router. It seems that webpack has this…
LoveProgramming
  • 2,121
  • 3
  • 18
  • 25
16
votes
4 answers

The 'mode' option has not been set, webpack will fallback to 'production' for this value.Field 'browser' doesn't contain a valid alias configuration

Project directory structure. Below are the webpack configuration files. webpack.config.client.js const path = require('path'); const webpack = require('webpack'); const CURRENT_WORKING_DIR = process.cwd(); const config = { name: 'browser', …