Skip to content

Add HMR when using component styles and template  #39367

Closed
@mikkelrd

Description

@mikkelrd

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Although the Angular+Webpack docs present the combo as "an excellent alternative to the SystemJS approach", loading component styles via styles or styleUrls results in a full page refresh, instead of style injection, which occurs when using SystemJS+lite-server.

Expected behavior

A core feature of using Webpack+Webpack-dev-server in development is the availability of Hot Module Replacement. It is expected that HMR would work for css injection regardless of the style loading strategy used. Instead, currently changes to css or scss files which are included in a component's styles result in a full page reload.

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Speed up the Angular 2 development process for CSS developers

Please tell us about your environment:

  • Angular version: 2.0.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript 2.02 | ES6/7 | ES5]

  • Webpack version: 1.13.2

  • Webpack-dev-server version: 1.14.1

  • Node (for AoT issues): node --version = 6.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compilerIssues related to `ngc`, Angular's template compilercore: hot module replacement (HMR)featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under consideration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions