Skip to content

vue-style-loader does not update styles with shadowMode + HMR #1581

Open
@alancnet

Description

@alancnet

Version

15.7.1

Reproduction link

https://github.com/alancnet/vue-style-loader-bug

Steps to reproduce

Steps to reproduce

  1. npm install
  2. npm start
  3. Visit http://localhost:8081 in your browser.
  4. You should see "Hello World" in red.
  5. Open src/app.vue
  6. Replace color: red; with color: blue; and save.
  7. Notice the color in the browser does not change.

How to fix

  1. Open webpack.config.js
  2. Replace loader: 'vue-style-loader', with loader: '@alancnet/vue-style-loader',
  3. Repeat steps 1-6 above.
  4. Notice the color changes.

or

  1. Open webpack.config.js
  2. Replace const shadowMode = true with const shadowMode = false
  3. Repeat steps 1-6 above.
  4. Notice the color changes.

What is expected?

The styles should update with hot module replacement

What is actually happening?

The styles do not update


I have a pull request that fixes this: vuejs/vue-style-loader#41

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