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

Sabaki: improve build size #98

Closed
1 task done
Terkwood opened this issue Aug 31, 2019 · 9 comments · Fixed by Terkwood/Sabaki#23
Closed
1 task done

Sabaki: improve build size #98

Terkwood opened this issue Aug 31, 2019 · 9 comments · Fixed by Terkwood/Sabaki#23
Labels
tech-debt Lib upgrades, Carryover from prior decisions, &c

Comments

@Terkwood
Copy link
Owner

Terkwood commented Aug 31, 2019

Summary

There was lots of bloat after adding preact material components

Tasks

  • Don't import all the preact-material-components JS
@Terkwood Terkwood added the tech-debt Lib upgrades, Carryover from prior decisions, &c label Aug 31, 2019
@Terkwood
Copy link
Owner Author

@Terkwood
Copy link
Owner Author

Terkwood commented Aug 31, 2019

CSS import strategy seems basically OK. The CSS file we bundle is under 5K

https://stackoverflow.com/questions/48603752/how-to-use-select-in-preact-material-components

@Terkwood
Copy link
Owner Author

@Terkwood
Copy link
Owner Author

Try import like import Dialog from 'preact-material-components/Dialog';

https://material.preactjs.com/component/dialog/

@Terkwood
Copy link
Owner Author

Probably we aren't tree shaking. Try switching import strat

https://material-ui.com/guides/minimizing-bundle-size/

@Terkwood
Copy link
Owner Author

Terkwood commented Sep 1, 2019

This isn't so straightforward. Using the recommended require syntax with ES5 doesn't work. Not sure if there's something we can do to the webpack config to make this right.

Ended up trying to reference a local file since webpack injected a path

Error: Module build failed: Error: ENOENT: no such file or directory, open '/PATH/TO/DEV/LOCAL/Sabaki/node_modules/process/browser.js'
``

@Terkwood Terkwood reopened this Sep 1, 2019
@Terkwood
Copy link
Owner Author

Terkwood commented Sep 1, 2019

Possible fix? webpack/webpack#2031 (comment)

@Terkwood
Copy link
Owner Author

Terkwood commented Sep 1, 2019

@Terkwood Terkwood changed the title Sabaki: investigate build size Sabaki: improve build size Sep 5, 2019
@Terkwood
Copy link
Owner Author

Terkwood commented Sep 6, 2019

Resolved

@Terkwood Terkwood closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Lib upgrades, Carryover from prior decisions, &c
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant