-
Notifications
You must be signed in to change notification settings - Fork 72
LG-5692 experiment - publishing both non-minified and minified bundles #3325
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
base: main
Are you sure you want to change the base?
LG-5692 experiment - publishing both non-minified and minified bundles #3325
Conversation
🦋 Changeset detectedLatest commit: e696014 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: +2.55 kB (+0.14%) Total Size: 1.8 MB
ℹ️ View Unchanged
|
8461d7d to
e98c775
Compare
71f2868 to
82c6e29
Compare
e98c775 to
b9c5489
Compare
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.
I'm wondering if minification should be part of the rollup build step rather than a separate lg-build minify command? Then where we want it generated for now we could just do so in the package rollup (charts/legend/rollup.config.mjs in this case). What are your thoughts on that?
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.
Hey Terrence, thanks for taking a look. That's definitely possible, but it would require running Rollup twice once with terse plugin and once without it. I was a bit concerned about the overhead of repeating transpilation, polyfilling, and other common steps.
In this approach, I tried to copy Underscore project's build config, which uses Rollup for transpilation and runs Terser as a separate script for minification. I figured that might be a more efficient approach.
Let me know if you like the other approach better or there's a 3rd better option.
https://github.com/jashkenas/underscore/blob/master/package.json
b9c5489 to
e696014
Compare
|
Coverage after merging cloudp-352308-env-specific-bundles-experiment into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
main←cloudp-352308-env-specific-bundles-experiment🎫 Ticket
LG-5692
📝 Description
This PR updates the build process so we generate both non-minified and minified versions of our bundles. Change is limited to
@lg-charts/legendpackage for experiment before we feel confident to apply it to all other packages. The default export inpackage.jsonis now the non-minified bundle, with the minified version provided as a production-specific export.Details
tools/build/src/minify.ts, which can be accessed either throughlg-build minifyorlg build-minify, to minify all non-minified JavaScript files located indist.--globargument (default is--glob=dist/**/*.*js --glob=!dist/**/*-min.*js)package.jsonexportsto default to the non-minified bundle, adding the minified bundle as a dedicated production export.Rationale
🧪 Documentation and Testing
@lg-charts/legendpackage, I confirmed locally that both non-minified and minified bundles work on MMS. Also can confirm that the minified bundle gets picked up by MMS's webpack configuration automatically.pnpm changesetand included documentation of changes