Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

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

Description

@kukjevov

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.

Activity

  1. added a commit that references this issue on Nov 18, 2016
  2. SteveSandersonMS commented on Nov 18, 2016

    @SteveSandersonMS
    Member

    That's strange. I tried to reproduce your issue, but everything worked perfectly well (the styles appeared, and HMR continued to work). So I'm not sure how to know what's going wrong in your case based on your config alone.

    Here's the code I used when attempting to repro the issue: e971dde

    Could you let me know whether that works for you? And if you're trying to do something different, what in particular is different in your scenario? Could you describe the full minimal set of changes needed to reproduce the issue based on the Angular2Spa code like in the branch I've linked to?

  3. SteveSandersonMS commented on Nov 21, 2016

    @SteveSandersonMS
    Member

    I'll close this since AFAIK it works and we don't have any repro steps that recreate the originally described issue.

    If anyone knows how to repro this, please file a new issue!

  4. kukjevov commented on Nov 22, 2016

    @kukjevov
    Author

    Hi thank you very much for your sample commit. Thanks to it i found solution :).

    Problem was that i included style.js in html head but it must be included in body after vendor.js. Now it is working. Thank you very much again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions