SpaServices Webpack Dev Middleware - automatic insertion of "webpack-hot-middleware/client" #1264

Closed
opened 2025-08-09 17:19:28 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @kukjevov on 11/15/2016

I have problem with automatic prepending of "webpack-hot-middleware/client" to each entry in webpack config.

Maybe i have something wrong in my configuration but. i have following configuration (snippet):

entry:
{
    "style": [path.join(__dirname, "content/site.scss")],
    "app": [path.join(__dirname, "app/app.ts")],
    "polyfills-import": path.join(__dirname, "app/polyfills.ts"),
    "vendor-import": path.join(__dirname, "app/vendor.ts")
},
module:
{
    loaders:
    [
        {
            test: /\.ts$/,
            loaders: ['awesome-typescript-loader', 'angular2-template-loader']
        },
        {
            test: /\.html$/,
            loader: 'raw-loader'
        },
        {
            test: /\.json$/,
            loader: 'json-loader'
        },
        {
            test: /\.scss$/,
            loaders: ['style-loader', 'css-loader', 'sass-loader']
        },
        {
            test: /\.(ttf|eot|svg)$/,
            loader: "file-loader"
        }
    ]
},

When you prepend that "webpack-hot-middleware/client" HMR string for each entry point my "style" entry does not inject css into html anymore. It works if you append it, but HMR is still not working for style entry, that means if i change something in scss, file is compiled, but nothing is replaced when finishes.

Maybe this is not problem of this middleware, maybe it is just my configuration which is not correct.

Thank you for your help.

*Originally created by @kukjevov on 11/15/2016* I have problem with automatic prepending of "webpack-hot-middleware/client" to each entry in webpack config. Maybe i have something wrong in my configuration but. i have following configuration (snippet): ```json entry: { "style": [path.join(__dirname, "content/site.scss")], "app": [path.join(__dirname, "app/app.ts")], "polyfills-import": path.join(__dirname, "app/polyfills.ts"), "vendor-import": path.join(__dirname, "app/vendor.ts") }, module: { loaders: [ { test: /\.ts$/, loaders: ['awesome-typescript-loader', 'angular2-template-loader'] }, { test: /\.html$/, loader: 'raw-loader' }, { test: /\.json$/, loader: 'json-loader' }, { test: /\.scss$/, loaders: ['style-loader', 'css-loader', 'sass-loader'] }, { test: /\.(ttf|eot|svg)$/, loader: "file-loader" } ] }, ``` When you prepend that "webpack-hot-middleware/client" HMR string for each entry point my "style" entry does not inject css into html anymore. It works if you append it, but HMR is still not working for style entry, that means if i change something in scss, file is compiled, but nothing is replaced when finishes. Maybe this is not problem of this middleware, maybe it is just my configuration which is not correct. Thank you for your help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1264
No description provided.