saguijs / sagui

:monkey: Front-end tooling in a single dependency
http://sagui.js.org/
MIT License
669 stars 32 forks source link

Enable transpile cache for babel-loader #381

Closed deepsweet closed 6 years ago

deepsweet commented 6 years ago

https://github.com/babel/babel-loader#options

cacheDirectory: Default false. When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run. If the value is blank (loader: 'babel-loader?cacheDirectory') or true (loader: babel-loader?cacheDirectory=true) the loader will use the default cache directory in znode_modules/.cache/babel-loaderz or fallback to the default OS temporary file directory if no znode_modulesz folder could be found in any root directory.

It's much faster with this option especially when you have dozens of files.

Here it looks like it's impossible to pass loader options from sagui.config.

pirelenito commented 6 years ago

That sounds interesting. We should try this out!

deepsweet commented 6 years ago

Definitely, in my experience webpack startup is up to 1.5 times faster when cache is hot on huge codebase.

On Tue, Jul 25, 2017 at 11:47, Paulo Ragonha notifications@github.com wrote:

That sounds interesting. We should try this out!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/saguijs/sagui","title":"saguijs/sagui","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/saguijs/sagui"}},"updates":{"snippets":[{"icon":"PERSON","message":"@pirelenito in #381: That sounds interesting. We should try this out!"}],"action":{"name":"View Issue","url":"https://github.com/saguijs/sagui/issues/381#issuecomment-317687112"}}}

pirelenito commented 6 years ago

Can you push a PR against the v11 branch with some benchmark comparisons? ❤️

pirelenito commented 6 years ago

Done and released in v11