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

Webpack - no output file generated?

I have the following webpack config: var path = require('path') var webpack = require('webpack') module.exports = { entry: { main: './scripts/app/main.js' }, output: { path: path.resolve(__dirname, './scripts/app/bundle/'), …
adam78
  • 9,668
  • 24
  • 96
  • 207
15
votes
5 answers

How to access assets with webpacker gem

Could you explain me how to access assets from webpacker gem within vue.js components? For example - how to create div with background image. I've tried use /app/assets/images and /app/javascripts/assets folders but images is only available in…
Alexey Poimtsev
  • 2,845
  • 3
  • 35
  • 63
15
votes
1 answer

webpack dev server: watch arbitrary directory files and reload

Is it possible to make webpack-dev-server reload whenever a specified set of arbitrary files changes? Something along the lines of: devServer: { watchTheseFiles: [ 'path/to/files', 'path/to/more/files' ] } And even more granularly, can I…
clo_jur
  • 1,359
  • 1
  • 11
  • 27
15
votes
3 answers

Use angular-cli with multiple path proxy matching

How can I define multiple paths to proxy in my proxy.conf.json? The angular-cli proxy documentation on github looks like you can only have one path (/api): { "/api": { "target": "http://localhost:3000", "secure": false } } But when I…
Hans
  • 681
  • 1
  • 9
  • 22
15
votes
2 answers

webpack-dev-server with hot reload reloading entire page with css changes

[Edit] Github Test Repo Created for you to test!! I have hot reloading without any problems, but it reloads the entire page whenever I make a single css change. I would like it to inject any css changes and ideally do similarly with react…
Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291
15
votes
3 answers

Webpack-dev-server proxy requests very slow

I am using webpack-dev-server proxy: devServer: { proxy: { '/api': { target: 'http://mybackedn.url', changeOrigin: true } } } Requests take too much time. Chrome network…
Sergey Tyupaev
  • 1,264
  • 9
  • 23
15
votes
3 answers

serve public static files with webpack

I struggle to get webpack configured as I want it to be. I run my dev-server on localhost:8080 and want to serve my app through localhost:8080/static/js/bundle.js and that is what I get with this webpack.config.js file I've attached below. in my…
Dima Gimburg
  • 1,376
  • 3
  • 17
  • 35
15
votes
1 answer

Webpack loads from the wrong URL when the path changes

I'm writing a react app and everything works fine when I navigate to localhost:3000, but when I try to go to localhost:3000/foo/page, I get an error message that tells me localhost:3000/foo/bundle.js cannot be loaded. To me, this looks like a…
Brandon Olivier
  • 578
  • 5
  • 16
15
votes
3 answers

What does the lazy mode of webpack dev server do?

I am running my webpack-dev-server with webpack-dev-server --lazy --inline --progress --colors --port 8082 However this shows a 404 error in my browser when it tries to access bundle.js. Everything else seems fine since if i replace --lazy with…
pdeva
  • 43,605
  • 46
  • 133
  • 171
15
votes
1 answer

Cannot start webpack-dev-server with gulp

When I run 'webpack-dev-server' from my terminal it runs fine : $ webpack-dev-server http://localhost:3333/ webpack result is served from /./assets/ content is served from C:\Users\Komo\Documents\work\training Hash: e705c984af7e83cbb685 Version:…
Komo
  • 2,043
  • 1
  • 22
  • 35
15
votes
4 answers

React.js Decorators are not supported yet in 6.x pending proposal update

The technologies that i am using to build my app is React, Web-pack, Babel and AlT(flux implementation) I'm getting an error when web pack tries to compile my app. Not sure what libraries i am missing. Could someone please advice ? ##.babelrc…
Erkan Demir
  • 785
  • 1
  • 8
  • 24
15
votes
2 answers

How to code HTML with jade and webpack with hot reload

I'm new with webpack, trying to setup simple config to code HTML/CSS with jade templates, PostCSS, hot reload and serve HTML through webpack-dev-server to speed up coding experience. So I will have multiple entry points, some jade files with…
arturkin
  • 958
  • 1
  • 6
  • 19
15
votes
4 answers

Module not found: Error: Cannot resolve module 'server'

I try to use webpack for managing files in my project. I use webpack-dev-server and bower-webpack-plugin. When I run server, I get error in browser console. Module not found: Error: Cannot resolve module 'server' webpack.config.js const…
Matt
  • 8,195
  • 31
  • 115
  • 225
14
votes
1 answer

Webpack config problems

I'm taking over a small react tooling project someone else had stopped maintaining. However, I can't get it to run. It's a problem with the webpack config, and I've attempted to reconstruct it at as small a size as possible but I can't get it to…
fesieg
  • 467
  • 1
  • 4
  • 14
14
votes
2 answers

Got error: Plugin/Preset files are not allowed to export objects, only functions

I got this error while setup my react app using the webpack and babel. I try to change the version of babel but still getting the same error. I'm not getting where's the problem. ERROR in ./src/index.jsx Module build failed (from…