Questions tagged [webpack-dev-middleware]

handles latest webpack output in memory for Express (node platform) web server (so it is an Express middleware)

Supports Hot Module Reload (HMR).

Used by webpack-dev-server internally (webpack-dev-server is a complete preconfigured Express server distribution)

https://github.com/webpack/webpack-dev-middleware

103 questions
1
vote
1 answer

Webpack-dev-server doesn't find files to serve

I just copy-pasted webpack-dev-server + express settings from webpack docs, but it doesn't work because the server can't find files to serve. What is wrong with this setup? server.js const express = require('express'); const webpack =…
1
vote
1 answer

Webpack HMR is requesting a wrong path on an express server

I'm trying to set up an express server for developing a React project with hot-reload, but the HMR thing requests the wrong path for some reason and I can't fix it by changing the "publicPath" option. It requests the "public" folder even though this…
1
vote
0 answers

webpack server serves different index.html files under different directories in multiple page application

I am developing a Web application of multiple pages with Webpack. In develop environment, I want Webpack server to open the index.html files under the different directories in url according to the file path, for example:…
1
vote
0 answers

webpack-dev-middleware serve/fallback to the public directory

Project structure: Webpack is building the app into the public folder At the same time I have some static assets located there, like: public/assets/font-awesome-4.7.0/css/font-awesome.css What I want: I want to run my express app with the…
Pavel Polyakov
  • 866
  • 1
  • 8
  • 13
1
vote
0 answers

Webpack hot-reload not updating reducers

I am running webpack-hot-reload and webpack-dev-server middlewares for express. My webpack configuration: const webpackConfig = { entry: [ project.app.entry, ], output: { path: project.path.out, filename:…
1
vote
1 answer

webpack-dev-middleware compiles twice on boot

With the same webpack.config.js, webpack-dev-server runs a compile once on boot, but my webpack-dev-middleware setup compiles twice immediately upon startup. I've added some logging in chokidar to make sure that a file change isn't happening and it…
Aaron Jensen
  • 6,030
  • 1
  • 30
  • 40
1
vote
1 answer

Can not export webpack.config when modules:false

Inside my index.js I am using webpack-dev-middleware/webpack-hot-middleware where I require my webpack.config and use it for compiler. index.js const webpack = require('webpack') const webpackConfig = require('../../webpack.config.js') const…
Igor-Vuk
  • 3,551
  • 7
  • 30
  • 65
1
vote
0 answers

webpack-dev-middleware post request error (vue-cli)

I'm writing OPA for some existing service using vue-cli and web pack template. Parent service loading app in iframe and gives it api access via postMessage. However in first open it seems to post some auth data which I don't need in my case, so when…
MadDocNC
  • 670
  • 5
  • 17
1
vote
0 answers

Webpack rebuild is slow using webpack-dev-middleware when building stylus

I'm using webpack 2, with the webpack-dev-middleware { test: /\.styl$/, use: [ 'style-loader', 'css-loader', { loader: 'stylus-loader', options: { use: [nib()], }, }, ] }, { …
Ed_
  • 18,798
  • 8
  • 45
  • 71
1
vote
2 answers

Webpack Hot Middleware not hot-reloading on Ubuntu with React?

I have run into a very frustrating problem where my webpack-hot-middleware is not 'hot reloading'. It is building the project, and rebuilding the project whenever I make any edits to any of my files in question but it seems to never show any changes…
0
votes
0 answers

Is there a way to achieve hot module reloading for a node server that responds with server side rendered React?

I have a node express server. This has a file called server.js that has a route called home that responds to the client with html. The content of the main div in the HTML is a react component (i.e root component for my App) that has been converted…
0
votes
0 answers

How to add proxy configuration in web.config file and remove from appsettings.json in .NET 6 with Angular 5?

How to Add proxy configuration inside web.config file by removeing proxy from appsettings.json file in .net6 with Angular 5? I tried to add proxy in web.config file by removing from appsetting.json file. Code added in web config file is as below…
0
votes
0 answers

Bundle Before Run with webpack-dev-middleware

I want to make use of Dockerfile mount caches so that the Webpack bundling process happens faster between docker runs. I have caching set up properly in all my Webpack config files, and my production dockerfile looks like this: FROM…
0
votes
0 answers

Error: Conflict: Multiple chunks emit assets to the same filename app.js (chunks polyfills and main)

I'm trying to package a manually created polyfills.ts with webpack because apparently it's not automatically emitted. Before adding my custom polyfills.ts (just remove the one line in the webconfig below) I currently get this error in the js console…
0
votes
0 answers

webpack-dev-middleware HookWebpackError: Unexpected end of JSON input

i'm getting this error while trying to upgrade an angular projet from v14 to v15. I checked all the checkpoints todo in order to upgrade to the new version. I've already did those manipulations: Delete the node_modules folder Delete the .angular…
Ricardo Machado
  • 787
  • 1
  • 8
  • 16