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
2
votes
2 answers

How to separate index.html and assets in webpack-dev-server?

i want to have the following build folder structure: /build/index.html /build/static/bundlename.js /build/static/bundlename.css /build/static/img/* /build/static/fonts/* How can i achieve this? I have figured out this by addition /static prefix to…
Rantiev
  • 2,121
  • 2
  • 32
  • 56
2
votes
1 answer

How to modify Webpack config to load modules from folder name

I'd like to load modules using just a folder name, without specifying file name in that specific folder. Like it's done here in react-starter-kit: I imagine that this is needed to be done in Webpack configuration, but I cannot wrap my head around…
Evaldas Buinauskas
  • 13,739
  • 11
  • 55
  • 107
2
votes
2 answers

React Chrome Tab Extension Not Working with WebPack Dev Server

My React Chrome extension does not appear on my React web app, even though I've got it reading all the components, rendering it all correctly. Everything is coming out as an iframe (screenshot attached). Here is my webpack.config.js file. var path…
2
votes
1 answer

Webpack React HMR: locals[0] does not appear to be a `module`

I am failing to set up Webpack with React HMR (and Babel). It seems to me that my setup is similar to the many examples I find here and there: My package.json dev depencencies: { // Only posting stuff that I think is relevant to this here …
Lukas
  • 9,752
  • 15
  • 76
  • 120
2
votes
0 answers

Gulp - Improve performance of gulp.watch on bundled js files

I am having issues with the performance of browser livereloading whenever I make a change to a js file. In my gulp setup, I have the following watches: gulp.task('watch', function() { gulp.watch(config.paths.html, ['html']); …
ericgrosse
  • 1,490
  • 20
  • 37
2
votes
1 answer

Use Webpack Dev Server to serve non-packed files

I currently use webpack-dev-server to serve a bundle of javascript packed by webpack. There are a few files that I would like served via the dev server, but not bundled in the with the rest. Is there a way to expose a route that does this? For…
Jack Slingerland
  • 2,651
  • 5
  • 34
  • 56
2
votes
0 answers

Babel/Webpack - Configuration for Hot Reloading Confusion?

I have been working on ReactJS for sometime now,I have come over quite a lot of modules eco-system (Webpack,Babel,React) etc.. I have some knowledge on webpack configuration,I have done basic configuration. See below const Path =…
Sathish
  • 2,056
  • 3
  • 26
  • 40
2
votes
1 answer

WebPack includes entire folder (mysterious ^\.\/.*$ added) with Summernote

Not sure why, but when importing Summernote into a build via WebPack, WebPack ends up pulling in the entire dist folder and thus complains that the fonts/images etc inside that folder are not valid JS. From the webpack output, you can see that it…
simbolo
  • 7,279
  • 6
  • 56
  • 96
2
votes
2 answers

Remove matched `/api` path in Webpack proxy

I have a backend service running at http://localhost:9090/. All calls starting with /api/* should be forwarded to it, without the /api in front of it. So when I call http://localhost:8080/api/my/route it should proxy to…
Narigo
  • 2,979
  • 3
  • 20
  • 31
2
votes
1 answer

Webpack dev server - having to change port every time I run it

I'm new to webpack-dev-server, and Im using it as part of test project in React. When I start the server first time, it works as expected. (I use an npm script to run it up via webpack.config.js) In the Mac terminal window, when I want to close the…
Dean Chalk
  • 20,076
  • 6
  • 59
  • 90
2
votes
1 answer

Using canjs with webpack

I am trying to use canjs with webpack. I am not able to get it working. Any help is appreciated. I did the following: Approach 1: I installed canjs using npm and in my main.js require('can'); Ran the webpack command. Did not work. The code was…
Ananth
  • 110
  • 3
  • 11
2
votes
0 answers

webpack-dev-server build takes a long time?

I have such a script to run inline webpack-dev-server: webpack-dev-server --hot --devtool eval-source-map --output-pathinfo --watch --colors --progress --inline --content-base public --port 8050 --host 0.0.0.0 Initial build takes a long time to…
Svitlana
  • 2,324
  • 4
  • 22
  • 31
2
votes
0 answers

Get webpack HotModuleReplacementPlugin recompile js at least for refresh

Sometimes you just want to start from the beginning. Is it possible to somehow do this on the dev server?
Cenoc
  • 11,172
  • 21
  • 58
  • 92
2
votes
4 answers

My npm start for react tutorial project is not working

I am trying to learn react and following egghead's video tut from https://egghead.io/lessons/react-react-fundamentals-development-environment-setup?series=react-fundamentals on setting up my dev environment. However, after installing relevant…
shailesh
  • 865
  • 1
  • 11
  • 18
2
votes
1 answer

Local area network visit node server with webpack-dev-server

I build a app with Express, React and Webpack. I used webpack-dev-server and react-hot-loader to live-loding. The Express server is on port 3000 and the webpack-dev-server servers files on localhost:8080. Now I want to visit the app from another…
Brick Yang
  • 5,388
  • 8
  • 34
  • 45