Editing and saving a scss partial does not properly trigger updates to the live build, requiring manual save of the root scss file.
.babelrc
{
"presets": ["env"]
}
package.json
{
"name": "ycharts",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "parcel index.html",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-preset-env": "^1.7.0",
"node-sass": "^4.9.0",
"parcel-bundler": "^1.8.1"
},
"dependencies": {}
}
Editing and saving a scss partial (dependency) should trigger a rebuild and update the development server.
I'm trying out Parcel with a very basic setup, mostly just following the documentation. Its quite annoying to make a change in a scss partial thats being imported into a main scss file, to then have to crtl + s on my index.scss to see the updates.
Really basic setup. index.scss imports some other scss partials, and index.js imports index.scss, I have no module reference errors and the code does work, its just the files that are being watched during development could be expanded.
index.html
<!doctype html>
<html lang="en">
<head>
<!-- Stuff -->
</head>
<body>
<script src="scripts/index.js"></script>
</body>
</html>
index.js
import '../scss/index.scss';
// stuff...
index.scss
@import 'variables';
@import 'typography';
@import 'ui';
body {
background-color: $dark;
}
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.8.2
| Node | 8.9.3
| npm/Yarn | 6.0.1
| Operating System | win10 64bit
@import 'variables';
@import 'typography';
@import 'ui';
Should probably be
@import './variables';
@import './typography';
@import './ui';
@DeMoorJasper This fixed the issue. I'm told theres a PR for this, but the idea would be to use standard sass syntax for partials.
_my-partial.scss Using underscore prefix for partials
@import 'mypartial' Using partial syntax (May need to implement ~ syntax to accommodate node_modules.
Current way to achieve proper HMR is to simply use straight files and import syntax.
my-partial.scss
@import './my-partial.scss'
Most helpful comment
Should probably be