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

Speed up webpack build #54

Merged
merged 6 commits into from
Jul 25, 2019
Merged

Speed up webpack build #54

merged 6 commits into from
Jul 25, 2019

Conversation

bru02
Copy link
Contributor

@bru02 bru02 commented Jun 21, 2019

Implement #44

@bru02 bru02 changed the title Implement #44 Speed up webpack build Jun 21, 2019
@KaelWD
Copy link
Member

KaelWD commented Jun 22, 2019

We had a lower-maintenance version of this previously: 3fea882

It may cause css problems as there is no longer a defined import order.

@kevinmarrec
Copy link

kevinmarrec commented Jun 26, 2019

@KaelWD It looks like that since your previous lower-maintenance version, you made imports sorted (https://github.com/vuetifyjs/vuetify-loader/blob/master/lib/loader.js#L31) could it prevent any css issue ?

I don't know much about the importance of css import orders but webpack build definitely need speed up, as for now a single import { VBtn } from 'vuetify/lib' webpack will still look for all components within vuetify/lib which means also all of their SASS files and that's too heavy extra processing.

Maybe it's an issue regarding how are exported components in vuetify/lib ? I know that some ways of using import/export (maybe export * from) are not treeshakable.
EDIT : It's anyway treeshaked but it still make Webpack compile/build all exports, so I think best solution is still this PR making vuetify-loader import components from their direct folders vuetify/lib/components/X.

@KaelWD
Copy link
Member

KaelWD commented Jul 3, 2019

made imports sorted

That was to fix vuetifyjs/vuetify#5271, didn't work

We do still have ordering problems (vuetifyjs/vuetify#3583) so maybe it won't be a problem. Either way I'd prefer to use my original code without hard-coded workarounds, we added structures to the vuetify repo specifically for this reason.

@kevinmarrec
Copy link

kevinmarrec commented Jul 3, 2019

@KaelWD I totally agree around the added structures, but something that is annoying is that Webpack seems to just go crazy and load/process everything when you simply do impport { VBtn } from 'vuetify/lib'.

For a little project which use only few components, ther's probably 80% unwanted webpack processing (lot of reached files which will be never used, it includes the loading and processing of unwanted SASS files of all components).

I think the issue has something to do with exports somewhere.

@KaelWD
Copy link
Member

KaelWD commented Jul 3, 2019

I'm referring to 3fea882 of course

Webpack processes everything and marks what's actually unused, then the minifier actually removes unused code.

@kevinmarrec
Copy link

Oh alright, I thought it was a performance issue (seeing all the Vuetify file names processed in Webpack bar progress)

@KaelWD KaelWD changed the base branch from master to feat/build-speed July 25, 2019 11:50
@KaelWD KaelWD merged commit 00219c9 into vuetifyjs:feat/build-speed Jul 25, 2019
@KaelWD
Copy link
Member

KaelWD commented Jul 25, 2019

Thanks for taking the time to do this @bru02. I've merged it into a feature branch for now because there's some changes I want to make before release.

@johnleider
Copy link
Member

Is this still something you are pursuing @KaelWD ?

@KaelWD
Copy link
Member

KaelWD commented Sep 6, 2019

No, it was released in 1.3

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

Successfully merging this pull request may close these issues.

4 participants