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
51
votes
5 answers

Webpack-dev-server doesn't generate source maps

I use babel-loader, but can't figure out how to generate or where find source maps for transpiled files. I tried eval-source-map, inline-source-map, source-map. webpack.config.js const BowerWebpackPlugin =…
Matt
  • 8,195
  • 31
  • 115
  • 225
48
votes
1 answer

Django, ReactJS, Webpack hot reload

I've been trying to set up a React component inside Django with the help of Webpack 4. To get me starting I went through and read: Using Webpack transparently with Django + hot reloading React components as a bonus Tutorial: Django REST with React…
Simon Johansson
  • 836
  • 6
  • 18
48
votes
3 answers

Difference between production and development build in ReactJS

Recently I started learning react and I saw a tutorial where they used Webpack to create the production and development builds. But there was no explanation on what the difference between those two builds is and which one you have to use when. I…
Blinxen
  • 807
  • 2
  • 13
  • 26
48
votes
5 answers

How to disable webpack dev server auto reload?

I know most people have the opposite problem but I actually want to disable the auto reload functionality. This is how I run my server: webpack-dev-server --open --progress This is my dev server config: devServer: { contentBase: 'app', …
Pawel Pabich
  • 2,404
  • 4
  • 22
  • 33
48
votes
2 answers

How to specify webpack-dev-server webpack.config.js file location

I am starting with webpack. I have been able to specify to webpack the location of webpack.config.js like this: "webpack --config ./App/webpack.config.js" Now I am trying to use the webpack-dev-server with that file also, but I can not find how to…
Mayday
  • 4,680
  • 5
  • 24
  • 58
48
votes
1 answer

Do I need webpack-dev-server if I am using a node server like express

I am following some tutorials to build an isomorphic app with express and react. I am confusing with the webpack-dev-server. The webpack tutorial says about the webpack-dev-server: This binds a small express server on localhost:8080 which serves…
Brick Yang
  • 5,388
  • 8
  • 34
  • 45
45
votes
11 answers

webpack.validateSchema is not a function

Webpack are throwing this error all of a sudden: TypeError: webpack.validateSchema is not a function Everything was working fine Friday, not working today. No new commits to master since Friday. Pruned NPM, that didn't work, deleted NPM folder and…
44
votes
1 answer

Webpack Dev Server with NGINX proxy_pass

I'm trying to get webpack-dev-server running inside a Docker container then accessing it through a NGINX host. The initial index.html loads but the Web Sockets connection to the dev server cannot connect. VM47:35 WebSocket connection to…
jshbrntt
  • 5,134
  • 6
  • 31
  • 60
43
votes
9 answers

Webpack command not found

I have installed webpack using npm install -g webpack and npm install webpack I also installed webpack-dev-server npm install -g webpack-dev-server After completion of installation, I ran the command webpack but, it shows below error webpack:…
Bishnu Bhattarai
  • 2,800
  • 8
  • 36
  • 44
43
votes
2 answers

Change hard coded url constants for different environments via webpack

I have a ApiCaller.js module which generate calls to our api server to get data. It has const field API_URL which points to server url. This API_URL const changes for dev and prod environments. So when I need to deploy to dev environment I need to…
WitVault
  • 23,445
  • 19
  • 103
  • 133
42
votes
8 answers

` __webpack_require__(...) is not a function` when using babel 6

Everything seems to build fine: http://d.pr/i/1aZxR with the following configs. However, when I run the code I get the following error this (via webpack-dev-server): Uncaught TypeError: __webpack_require__(...) is not a function(anonymous function)…
chuliamiz
  • 421
  • 1
  • 4
  • 4
41
votes
2 answers

Why does my React Component Export not work?

I was just getting into react and trying it out for myself. After hours of configuring webpack just to get a hello world on my screen I thought I could get going now but after trying to render another component from a file the next problem. My main…
gerdtf
  • 685
  • 1
  • 7
  • 12
40
votes
1 answer

Customise ng serve to proxy calls to /api?

I created a new application with ng CLI, works like a charm: ng new babysteps cd babysteps ng serve ng serve uses webpack to assemble the app. To fully test it, I need to serve /api... from my API mock server (specifically the POST requests). How…
stwissel
  • 20,110
  • 6
  • 54
  • 101
39
votes
3 answers

How to watch certain node_modules changes with webpack-dev-server

I'm currently experimenting with a monorepo architecture. What I would like to do is in my web package where I run webpack dev server I'd like it to watch certain node_modules (symlinked local packages) for changes and trigger a "rebuild". This way…
noherczeg
  • 478
  • 1
  • 4
  • 8
39
votes
8 answers

Webpack-dev-server not bundling even after showing bundle valid message

I've set up a basic react application with webpack but I couldn't get the webpack-dev-server running properly. I've installed webpack-dev-server globally and tried running the command sudo webpack-dev-server --hot as hot reloading was required.…
Karthik Rana
  • 1,261
  • 1
  • 10
  • 20