Closed Immortalin closed 5 years ago
@samrith-s any suggestions for how to fix this?
Reopening while there is still an active PR.
@Immortalin Please don't use Closes x
in the title. Use Fixes x
in the description instead.
Quick question, why is this needed in watch
or serve
mode?
This is an expensive operation, as it traverses all the files and modifies them. When you watch, it'll happen every time Parcel builds. From the Parcel docs, even during serve
, the bundler emits buildEnd
. This plugin hooks on to that event, and runs once it the build has ended.
It would be a very bad idea to make it run on watch
and serve
, as it will do really expensive operations in the dist
folder every time you do any modifications to any file watched by Parcel.
Closing due to no response.
Hi sorry I just noticed this. My reason for adding build mode is because if you are working with Web frameworks like Django etc. you need live loading support. Webpack has support for this.
Here are some points to consider:
Keeping these in mind, it is not a very viable option to run it every time.
Hmm, then how do webpack et al. usually do it? Perhaps we can cache most of the ops?
Maybe we can, but that's an insane amount of heavy lifting for a plugin. It's not possible to do a compare operation on every save and update parts of the file. That's a task for the bundler to do, and would require a big overhaul. Should not be done within the scope of this plugin.
Alternatively, what we can do, is add the mode, but document it with a very clear warning about performance implications.
Sure that could work, feel free to modify the pull.
I'm reopening your PR. But it has failed the Codacy tests. Please ensure your PR follows code quality standards, I'll review it then.
Send me the link to the failing test
It's on the PR itself. https://app.codacy.com/app/samrith/parcel-plugin-structurize/pullRequest?prid=3745658
Marking this as won't fix, as it is not in the scope of this plugin.
This currently doesn't run in watch mode.