-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HotReload doesn't work with sass plugin #37
Comments
A hacky fix is to detect .scss and then manually delete the root .scss and reload it. hotReload (moduleName) {
const self = this
const start = new Date().getTime()
if (moduleName.endsWith('.scss')) {
var rootSCSS = 'app/web/app.scss!';
return System.normalize(rootSCSS).then(function(normalizedName){
System.delete(normalizedName)
return System.import(rootSCSS)
})
}
this.modulesJustDeleted = {} // TODO use weakmap
//etc...
|
The way I expected to handle this was for the plugin itself to provide the hot reload hooks for the dummy module representing each sass file. But let me know if that approach doesn't work out? |
That should work. You would need to do an interception, similar to how I'm doing it here, as chakara will send over all the paths. This would need to be supported by jspm though. Its not something that can be neatly added by a user. |
As far as I can see, the sass import tree isnt recognosed by systems module loading scheme as this is specific to sass. As such editing a child .scss file doesnt update the root. It might be a good idea for plugins to offer a hotReload hook so as to allow each plugin to handle its own hot reload logic, instead of adding something custom to the hot-reloader core.
Sass/css hot reloading is important, especially if this is going to integrated to the jspm core. @guybedford
The text was updated successfully, but these errors were encountered: