You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parcel only recompiles the files that got changed but if I add a new file, apparently it does not get detected but is there a way for parcel to monitor for new files when 'import' statement matches the criteria? (Currently, I'm using an external process 'onchange' to detect for new files.)
For example, if I have,
import './style/*.css'
and 'style' directory has 'a.css' and 'b.css', they get compiled upon modification but if I add 'c.css' into it, parcel obviously cannot detect it as it was never imported on launch and an external mechanism is required for this to be bundled but is this possible for parcel to implement such detection?
🤔 Expected Behavior
Bundle the newly added file incrementally if it matches 'import' matching criteria.
😯 Current Behavior
Newly added file is ignored.
💁 Possible Solution
Current possible solution is to use another daemon such as 'onchange' to detect for new file addition (but do not restart on file modification as parcel picks it up for incremental bundling by using --filter option for 'onchange') and restart parcel through it but this is slow as the entire bundle has to be rebuilt.
If this is going to be implemented internally, it should listen for 'add' and 'unlink' events coming from chokidar (or any file system monitoring package that can do similar.) and initiate the incremental bundling process.
💻 Code Sample
It can currently be achieved by the following combination, but with a heavy restart on file addition and deletion.
🙋 feature request
Parcel only recompiles the files that got changed but if I add a new file, apparently it does not get detected but is there a way for parcel to monitor for new files when 'import' statement matches the criteria? (Currently, I'm using an external process 'onchange' to detect for new files.)
For example, if I have,
and 'style' directory has 'a.css' and 'b.css', they get compiled upon modification but if I add 'c.css' into it, parcel obviously cannot detect it as it was never imported on launch and an external mechanism is required for this to be bundled but is this possible for parcel to implement such detection?
🤔 Expected Behavior
Bundle the newly added file incrementally if it matches 'import' matching criteria.
😯 Current Behavior
Newly added file is ignored.
💁 Possible Solution
Current possible solution is to use another daemon such as 'onchange' to detect for new file addition (but do not restart on file modification as parcel picks it up for incremental bundling by using --filter option for 'onchange') and restart parcel through it but this is slow as the entire bundle has to be rebuilt.
If this is going to be implemented internally, it should listen for 'add' and 'unlink' events coming from chokidar (or any file system monitoring package that can do similar.) and initiate the incremental bundling process.
💻 Code Sample
It can currently be achieved by the following combination, but with a heavy restart on file addition and deletion.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: