Parcel: `Serve` not refreshing Vue template styles, but `Build` does

Created on 3 Jul 2018  路  2Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

When using the server (with or without HMR), it doesn't recognize styles in <style> block within a Vue template. This problem is within HMR, but style changes are also not picked up when doing a manual refresh in the browser.

馃帥 Configuration (.babelrc, package.json, cli command)

No .babelrc. I'm using the vue template compiler feature of Parcel. I've got a mini test repo here.

{
  ...
  "scripts": {
    "build": "parcel build src/index.html --public-url .",
    "serve": "parcel src/index.html"
  },
  "devDependencies": {
    "@vue/component-compiler-utils": "^2.0.0",
    "node-sass": "^4.9.0",
    "parcel-bundler": "^1.9.3",
    "vue-template-compiler": "^2.5.16"
  },
  "dependencies": {
    "vue": "^2.5.16",
    "vue-hot-reload-api": "^2.3.0",
    "vue-router": "^3.0.1"
  },
  "alias": {
    "vue": "./node_modules/vue/dist/vue.common.js"
  }
}

Reproducing the Bug

  1. run npm install to set up the app
  2. run npm run build.
  3. open src/Home.vue and add some styles in the <style> block at the bottom.
  4. run npm run build again. Those styles will be reflected in the built page.
  5. Now run npm run serve and open localhost:1234
  6. Now make edits to the styles in that same style block, save, and see that they are not reflected in the served page.
  7. Refresh the served page, and your new styles are still not showing up.
  8. If you run npm run build again, your new styles _do_ show up.

馃 Expected Behavior

While running serve, when modifying the styles within the <style> block in a Vue template, those styles should immediately be reflected in what the Parcel server outputs.

馃槸 Current Behavior

In order to get the styles to be reflected in the app, I have run the build command. Then all works as expected. However, when running the serve command, changes to those styles are not picked up.

馃敠 Context / Environment

Example mini repo: https://gitlab.com/jake.paris/parcel-bugtest

馃實 Your Environment

I'm using Parcel 1.93, npm, on a Mac.

Bug Stale Vue

Most helpful comment

I'm running into this exact same thing. I'm relieved to discover that this is a known bug, since I'm new to Parcel and I thought I might be doing something wrong.

All 2 comments

I'm running into this exact same thing. I'm relieved to discover that this is a known bug, since I'm new to Parcel and I thought I might be doing something wrong.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings