parcel-plugin-custom-dist-structure: SCSS Hot Reload fails if options.development: true

Hi there, after scratching my head for awhile today to figure out why the hot reload was no longer working when I made changes to a scss file, I realized that my problems vanished when I set development to false and not have my folders structured while developing.

The styles do update however, if I save my entry file (index.html) in this case.

I am simply including the scss file in the index.html via <link> tag.

Here are my configurations. Note that in this case, everything works as intended. However, if I change the options.development to true in the package.json file, then SCSS hot reloading no longer works.

package.json

{
  "name": "example",
  "version": "1.0.0",
  "description": "Example",
  "scripts": {
    "start": "parcel ./src/index.html --out-dir build/dev",
    "build": "parcel build ./src/index.html --out-dir build/prod"
  },
  "author": "Chuck Taylor",
  "license": "MIT",
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/preset-env": "^7.9.5",
    "cssnano": "^4.1.10",
    "parcel-plugin-custom-dist-structure": "^1.1.3",
    "parcel-plugin-nuke-dist": "^1.0.1",
    "sass": "^1.26.3",
    "typescript": "^3.8.3"
  },
  "customDistStructure": {
    "config": {
      "scripts": [
        ".js",
        ".js.map"
      ],
      "styles": [
        ".css",
        ".css.map"
      ],
      "images": [
        ".jpg",
        ".png",
        ".svg"
      ]
    },
    "options": {
      "development": false
    }
  },
  "dependencies": {}
}

.browserslistrc

# Supported Browsers
defaults

.babelrc

{
  "presets": ["@babel/preset-env"]
}

postcss.config.js

module.exports = {
  plugins: [require('autoprefixer'), require('postcss-nested')],
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Wellโ€ฆ I have it working finally. ๐Ÿ˜ƒ I can confirm that hot-reloading is working just fine, and the folders are being nicely organized even when options.development is set to true.

Iโ€™m not saavy with these symlinks etc (As Iโ€™m sure you gathered), but I am guessing this issue is at play as per the yarn issue I linked to previously.

I finally found /Users/chuckntaylor/.config/yarn/global/node_modules/parcel-bundler I navigated there and entered yarn link. This gave the following output:

success Registered "parcel-bundler".
info You can now run `yarn link "parcel-bundler"` in the projects where you want to use this package and it will be used instead.

Then back in my app root folder I entered yarn link parcel-bundler and everything finally clicked.

Thank you for your patience, and your time spent troubleshooting an issue outside the scope of your project.

Awesome ๐Ÿš€ Thank you for verifying the changes. Iโ€™ll publish the new release on Thursday, together with #10. Until then you can keep using this approach with an absolute path.

I wonโ€™t lie, I donโ€™t fully understand everything you just mentioned. ๐Ÿ˜† But, yes! Totally works! ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰