-
Notifications
You must be signed in to change notification settings - Fork 28
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
Rebuild not starts if changes were done in included template file #13
Comments
I have the same problem with scss files that import other files. Changes to the base file trigger a reload, changes to included files are logged, but do not trigger a reload |
This is the current expected behavior. @blunckr The rebuilder function only runs changed source directory files through metalsmith's build change. https://github.com/FWeinb/metalsmith-watch/blob/master/lib/index.js#L29-#L30 . Your main .scss file isn't getting rebuilt with your new partial. Ideally, metalsmith-watch would let you specify multiple mappings of source glob patterns to rebuild glob patterns, similar to gulp.watch. The simplest fix for now though might be an optional flag to rebuild all files upon any change. If @FWeinb wants to weigh in here, I wouldn't mind making a PR on the simpler (temporary?) fix. |
Interested for that too. |
I got a simple idea to implement: what if we just add an map option to say what will rebuild what ? watch({
rebuildMapping: {
"src/templates/**/*": "src/*", // editing a templates will trigger rebuild for everything
"src/css/**/*": "src/css/*" // editing any css will rebuild css entry points
}
}) @FWeinb what do you think about that ? I am open to make a PR for this. |
@MoOx I like that. Would like your PR. I don't have much time to work on this. |
+1 |
This looks awesome. I don't have much time to maintain this plugin but I can give you commit rights on this repo and add you to the author list on npm so you could publish the updated plugin yourself. Would that be ok with you? |
yup. |
Awesome. You can push to this repo now. Will add you to npm once I am at home. |
Cool, I will push things when I get some times too. Glad to be a collaborator :) |
@MoOx |
Don't worry, I am a semver fanboy ;) |
👍 |
- Fixed: metalsmith-collections are now correctly adjusted to avoid duplicates entries after rebuilds) - Removed: `pattern` option has been remove. Please use the new `paths` option - Added: `paths` option allows you to specify a map to trigger rebuilds (closes [#4](#4) and [#13](#13)) - Added: `log` option to be able to control watcher logs - Added: when a JavaScript file is changed, the corresponding cache in node/iojs cache is refreshed. This is particularly handy when working with plain JavaScript template (eg: react template made with [metalsmith-react](https://github.com/MoOx/metalsmith-react)) Closes #4 Closes #13 Closes #17 Closes #18
I opened a PR for this #19 |
- Fixed: metalsmith-collections are now correctly adjusted to avoid duplicates entries after rebuilds) - Removed: `pattern` option has been remove. Please use the new `paths` option - Added: `paths` option allows you to specify a map to trigger rebuilds (closes [#4](#4) and [#13](#13)) - Added: `log` option to be able to control watcher logs - Added: when a JavaScript file is changed, the corresponding cache in node/iojs cache is refreshed. This is particularly handy when working with plain JavaScript template (eg: react template made with [metalsmith-react](https://github.com/MoOx/metalsmith-react)) Closes #4 Closes #13 Closes #17 Closes #18
- Fixed: metalsmith-collections are now correctly adjusted to avoid duplicates entries after rebuilds) - Removed: `pattern` option has been remove. Please use the new `paths` option - Added: `paths` option allows you to specify a map to trigger rebuilds (closes [#4](#4) and [#13](#13)) - Added: `log` option to be able to control watcher logs - Added: when a JavaScript file is changed, the corresponding cache in node/iojs cache is refreshed. This is particularly handy when working with plain JavaScript template (eg: react template made with [metalsmith-react](https://github.com/MoOx/metalsmith-react)) Closes #4 Closes #13 Closes #17 Closes #18
If template has kind of "include/extends" directive, then watcher detects changes in included/extended file, but it doesn't make a rebuild. Example:
index.jade:
_base.jade:
Run
node build.js
. Now modifyindex.jade
, plugin detects changes, rebuilds and notifies browser. This is OK.Then modify
_base.jade
– plugin detects changes, but no rebuild/notification happens. This is NOT OK.The text was updated successfully, but these errors were encountered: