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

webpack-dev-middleware: options has an unknown property 'logLevel'

I'm currently upgrading Webpack + related modules and am getting the following error. It's a bit confusing as we don't specify the mentioned config param. Any help would be appreciated. [webpack-cli] Invalid options object. Dev Middleware has been…
2
votes
0 answers

Webpack 5 build goes two times repeatidly after save

After upgrading webpack to version 5, it compiles twice at a time after making any changes and saving it which is increasing build time. I am using webpack-dev-middleware: "^4.1.0" and webpack-hot-middleware: "^2.25.0". This is how I am using…
2
votes
1 answer

How to auto-refresh the browser on .ejs changes when using express + webpack middlewares?

I have set up a server using express and the webpack-dev-middleware and webpack-hot-middleware that is currently accepting module replacements for the .js files. Here is the setup I have currently: server.js (backend) const express =…
2
votes
0 answers

How to add webpack-dev-middleware to existing node/react app

I have an existing app that runs nodejs and express on the server side and React on the client side. Typescript is used throughout. The client side code was created with create-react-app and has since been ejected. This code is in /client. The…
Jed Veatch
  • 2,326
  • 3
  • 12
  • 13
2
votes
1 answer

Webpack 4: Module parse failed: Unexpected token

During my builds, webpack is giving me this error: ERROR in ./client/components/App/index.tsx 15:9 Module parse failed: Unexpected token (15:9) You may need an appropriate loader to handle this file type. | | > const App: SFC = () => ( | …
2
votes
0 answers

webpack-hot-middleware doesn't generate hot-update.json file

I'm trying to get up and running my app using webpack-dev-middleware, webpack-hot-middle-ware, express and react. But when I startup my code, system doesn't give me [hash].hot-update.json file. When I change something in my code system rebuilds and…
2
votes
1 answer

How can I set the webpack --mode using webpack-dev-middleware?

I have an express server that runs my app using webpack-dev-middleware and webpack-dev-server. After updating to webpack@4.1.1 I get the following warning WARNING in configuration The 'mode' option has not been set. Set 'mode' option to…
2
votes
0 answers

access array of middlewares in webpack-middleware

we have lecasy application written using grunt. It also uses this thing https://github.com/gruntjs/grunt-contrib-connect which gives us possibility to use array of middlewares so that we are able now to add or unshift middleware like so:…
2
votes
0 answers

webpack-hot-middleware doesn't remove element but add new ones on refresh

I'm trying to make a quick boilerplate for a project but I'm struggling with a problem when reloading the page. I have this piece of code in my app.js: import * as d3 from 'd3' import { Hello } from './component' import css from…
2
votes
0 answers

How to access/inject global variables in wds express middleware

I wanted to intercept the connection from wds to client on every change so that before it refreshes/hot reloads I want to fetch a token which can be injected to the angular app. I've added a preprocesor middleware to the webpack dev server using the…
2
votes
1 answer

webpack-hot-middleware not working with webpack-dev-middleware

I'm trying to use webpack-hot-middleware to hot reload the modules of my application. I'm using webpack-dev-middleware as well. Here is my setup. package.json { "name": "dev-front-end", "version": "1.0.0", "description": "", "main":…
2
votes
0 answers

OWIN Selfhost with webpack-dev-middleware and webpack-hot-middleware

I wonder if there any nuget package exists for integration of webpack-dev-middleware and webpack-hot-middleware with OWIN Selfhost full .Net46 like for AspNetCore - Microsoft.AspNetCore.SpaServices?
2
votes
0 answers

ERROR in multi, Module not found: Error: React Hot Loader@next Universal Rendering

I am using "webpack": "^2.4.1", "webpack-dev-middleware": "^1.10.2", "react-hot-loader": "next", "webpack-hot-middleware": "^2.18.0", Here is webpack client config entry entry: { main: [ 'react-hot-loader/patch', …
2
votes
2 answers

Webpack Not Rebuilding on Change

For some reason I can't get webpack to rebuild my files on change. I basically followed the Browsersync - Webpack + TypeScript Recipe. My webpack.config.js: let path = require('path'); let webpack = require('webpack'); let config = { debug:…
Bob
  • 821
  • 1
  • 17
  • 36
2
votes
1 answer

Why webpack-dev-middleware provides `publicPath` configuration?

From the readme of webpack-dev-middleware, there is a publicPath configuration: publicPath: "/assets/", // public path to bind the middleware to // use the same as in webpack But I'm not sure why there is such a configuration since there is…
Freewind
  • 193,756
  • 157
  • 432
  • 708