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
1 answer

How to do custom formatting of build stats with webpack-dev-middleware?

I am currently using the basic Webpack API with a custom printer for the build results, i.e.: import webpack from 'webpack' webpack({ /* webpack config */ }, printStats) function printStats(err, stats) { // my custom printing of build…
Tom Crockett
  • 30,818
  • 8
  • 72
  • 90
2
votes
1 answer

Webpack dev middleware not serving bundle.js correctly

I'm trying to make my own redux starter kit and have been refactoring it a bit, but somehow now my bundle.js (and style.css) aren't served to the page correctly by webpack-dev-middleware. It's been bugging me that I can't find a solution, so here I…
Jori
  • 222
  • 1
  • 2
  • 10
1
vote
0 answers

Webpack-dev-middleware and webpack-hot-middleware configuration

I have some conceptual troubles with webpack-dev-middleware and webpack-hot-middleware I have SSR app (react + express), webpack (with clientside and serverside configs). Webpack configs: client.config const config: Configuration = { name:…
1
vote
1 answer

Webpack dev-server proxy to localhost

I am struggling with webpack dev server proxy. I am using webpack 5. The goal is to have webpack dev server with local Apache api (PHP/Laravel). Webpack dev server has this settings: devServer: { host: 'localhost', port: 8080, hot:…
Peter Matisko
  • 2,113
  • 1
  • 24
  • 47
1
vote
0 answers

how can I set envrionmental variable with webpack-dev-middleware?

I have a webpack project that serving files with webpack-dev-middleware. here is the server setup. const webpackMiddleware = require("webpack-dev-middleware"); const webpackHotMiddleware = require("webpack-hot-middleware"); const webpack =…
Yilmaz
  • 35,338
  • 10
  • 157
  • 202
1
vote
0 answers

How to configure Webpack for development in a Vue.js app with server-side rendering

I have a standard folder structure that is a bit like this: . ├── dist | ├── vendor.js | └── app.js | └── index.html ├── src | └── index.html | └── entry.js // main app entry file | └── entry-client.js //…
volume one
  • 6,800
  • 13
  • 67
  • 146
1
vote
0 answers

Webpack-Dev-Middleware, Express and Webpack generated views. How is this suppose to work?

publicPath in Webpack config is set to /contents/dist/assets/ a view file in Express uses handlebars in Webpack config, handlebars template is setup to output correct script tags / link stylesheet.. new HtmlWebpackPlugin({ template:…
GN.
  • 8,672
  • 10
  • 61
  • 126
1
vote
1 answer

Webpack server non documented property exists?

Documentation is mentioning that Options that are compatible with webpack-dev-middleware have next to them. I can't find anything about "cookieDomainRewrite" but if I use it works Any explanations? Or ideas how I can investigate it further?
1
vote
0 answers

How can I ignore changes to index.html when compiling with dev/hot-middleware?

I am using webpack-dev-middleware and webpack-hot-middleware with html-webpack-plugin. The html plugin is injecting a script dependent upon the environment, but the problem is that this injection triggers another compile, which then causes the html…
Devin Fields
  • 2,066
  • 1
  • 10
  • 18
1
vote
0 answers

webpackDevMiddleware & webpackHotMiddleware slow down the server

I've added the hot-reload on an express app in using webpackDevMiddleware & webpackHotMiddleware but I notice that this 2 middleware slow down the app, I think is normal that the first start should be slower becuase I need to compile everything but…
1
vote
0 answers

webpack-dev-middleware My ts module parsing error after use?

this is error message 1 I don't know why, my package goes to the folder where the current file is located instead of going to node_modules. this is error message 2 This is my root Folder tree: . ├── dist ├── gulpfile.js ├── interface ├──…
XuZiHao
  • 21
  • 3
1
vote
0 answers

SCSS Loader failure when using express and dev middlewares with webpack 4

I have a project on React built with webpack 4. For server side rendering I constructed express backend and use webpack-dev-middleware, webpack-hot-middleware and webpack-hot-server-middleware. Also, there are webpack configs for client and node…
1
vote
1 answer

webpack-merge entry point

I have broken up my webpack config files in to 3 separate files as suggested in webpack 4.1 docs using webpack-merge to merge them together. webpack.common.js webpack.dev.js webpack.prod.js The problem I'm running into is i'm using…
me-me
  • 5,139
  • 13
  • 50
  • 91
1
vote
0 answers

Vue Server-Sided Rendering Hot Module Reloading Support for new modules

Vue offers a HackerNews example to demonstrate how to do server-sided rendering along with hot module reloading support. Basically, the client and server side code are split into two files: are compiled into two json files entry-client.js and…
1
vote
0 answers

How do you render custom variables into HTML with webpack-dev-middleware?

I use Webpack to compile my JS which is then loaded via bundle.js via a template string sent via express. The only problem is, I can't find information on how to render custom html while also using webpack-dev-middleware to watch and compile…
sparcut
  • 795
  • 1
  • 10
  • 27