preact-cli
preact-cli copied to clipboard
Use `preact` and `preact-router` from source instead of dist
Do you want to request a feature or report a bug? Bug
What is the current behaviour?
We use preact and preact-router from their dist folder on npm
What is the expected behaviour?
Since we transpile node_modules ourselves we should be using preact and preact_router from their source. This will have no affect on the regular bundles but will have some saving on the module bundle generated.
If this is a feature request, what is motivation or use case for changing the behaviour? Web perf
Please mention other relevant information.
- Node version: any
- npm version: any
- Operating system: any
- CLI version: next
- Browser: any
Thumbs down
no? because?
Preact & Router are super optimized distributions. No user-settings are going to match it. /cc @developit
Now thats a thing I never knew, super interested in learning what is it?
Follow here. IIRC it's circa ~1kb savings. This is actually (can) happen often, and is part of the reason why bundling from node_modules is not the norm... for now.
feel free to close :), if there's no better solution
@developit We spoke about moving the optimizations to build size into preact-cli and applying these across all source instead of just one off packages.
Perhaps now is the time, or 3.1.0.
I'd support that 👍 It was a thumbs-down for present situation.
My original intention for CLI was to extract some of the config into standalone chunks. I finally got around to the Babel stuff (#639), but an uglify package was on my radar too. Perhaps the mapping lives there?
Another thing we can consider here is applying the Preact's minification processes to a bundled JS Modules version - with constant inlining, hoisting and a customized terser config I'm sure it'd be reasonably close to what preact ships over the wire today.