-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor to use a disk-persistent cache. #84
Conversation
This should speed up future rebuilds more than the old in-memory cache, as it will also cache the preprocessed AST and only re-read/parse files that were modified. The speed gain should be even greater on compile-to-js languages as recompilation of unmodified files will be completely skipped. Fixes michaelficarra#83.
Enabling this option will make commonjs-everywhere replace all module names by a unique integer id instead of the root-relative path. This will improve minification a little but will break code that uses __dirname or __filename (which should not be very common in browser-compatible libraries)
# object whose toString method produces the same output as calling | ||
# toString in the original RegExp object. | ||
node.value = [node.value.toString()] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break any AST-processing code that needs to inspect regexp literals other than calling its 'toString' method
manual source map computation instead escodegen to generate the final result
handler extensibility to enable usage of input source maps
since its like 10x faster. Also fixed concatenated source map generation
for reuse with the grunt task
Also by default, dont check if npm modules were changed(very unlikely that npm modules will change)
with on-demand inclusion
a module uses __filename or __dirname a map will be added for that module
self-generated node.js bundle
with many configurations
the actual positions in the result source map
I'm closing some this pull request because I've changed the code too much |
Why did you push all of this to |
You can still merge if you need, but since I refactored so much I assumed you would not want it |
Besides the code kinda dirty, I wasnt careful about code style or organization |
I have documented the modifications here: https://github.com/tarruda/powerbuild |
This should speed up future rebuilds more than the old in-memory cache, as it
will also cache the preprocessed AST and only re-read/parse files that were
modified. The speed gain should be even greater on compile-to-js languages as
recompilation of unmodified files will be completely skipped. Fixes #83.
I've noticed a small speed loss on the first build probably due to stringifying/writing cache to disk, but after that every rebuild is faster than before.