Skip to content
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

🙋 Incremental bundling on new files #754

Closed
windware-ono opened this issue Feb 6, 2018 · 1 comment
Closed

🙋 Incremental bundling on new files #754

windware-ono opened this issue Feb 6, 2018 · 1 comment

Comments

@windware-ono
Copy link

windware-ono commented Feb 6, 2018

🙋 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,

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.

onchange 'style/**' --initial --filter add,unlink parcel watch app.js
touch style/c.css
rm style/c.css

🌍 Your Environment

Software Version(s)
Parcel 1.5.1
Node 8.9.4
npm/Yarn 5.6.0
Operating System Ubuntu 16.04
@windware-ono windware-ono changed the title Incremental bundling on new files 🙋 Incremental bundling on new files Feb 6, 2018
@mischnic
Copy link
Member

mischnic commented Mar 18, 2019

Should be fixed in 1.12.0: #2615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants