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

Preserve ES modules and enable treeshaking #3563

Merged
merged 11 commits into from May 10, 2021
Merged

Preserve ES modules and enable treeshaking #3563

merged 11 commits into from May 10, 2021

Conversation

tnorling
Copy link
Collaborator

@tnorling tnorling commented Apr 30, 2021

This PR makes several changes to the rollup configs for msal-common and msal-browser:

  • ES Module builds preserve the file structure to enable treeshaking - Thanks @thoo1!
  • msal-browser does not bundle msal-common with the es module build
  • Removes msal-common UMD bundle generation as we don't upload to CDN

Dependency updates:

  • Updates rollup to version 2
  • Replaces deprecated rollup-plugin-node-resolve package with @rollup/plugin-node-resolve
  • Removes rollup-plugin-json as it's no longer needed

This is a first step towards reducing bundle size. Next step is to refactor some of our code to make it possible to be treeshaked.

thomas-oo and others added 9 commits March 24, 2021 19:57
…fig.js. this makes the tree shaking work"

This reverts commit cc4b469.
…es instead of bundling, and add sideEffects: false to enable tree-shaking. So far, I've just commented out the other builds to test, and tree-shaking from the consumer now works!
…msal-browser

Make msal-browser and msal-common package preservedModules and mark sideEffects: false to enable tree-shaking for consumer
@github-actions github-actions bot added msal-browser Related to msal-browser package msal-common Related to msal-common package labels Apr 30, 2021
@coveralls
Copy link

coveralls commented Apr 30, 2021

Coverage Status

Coverage remained the same at 83.806% when pulling 660e338 on treeshaking into f2a189f on dev.

@tnorling tnorling marked this pull request as ready for review May 10, 2021 16:40
@tnorling tnorling added this to the @azure/msal-common@4.2.2 milestone May 10, 2021
@tnorling tnorling linked an issue May 10, 2021 that may be closed by this pull request
10 tasks
@jasonnutter jasonnutter merged commit 9d70339 into dev May 10, 2021
@jasonnutter jasonnutter deleted the treeshaking branch May 10, 2021 20:16
pkanher617 pushed a commit to pkanher617/microsoft-authentication-library-for-js that referenced this pull request Dec 30, 2021
Preserve ES modules and enable treeshaking
azure-pipelines bot pushed a commit to pkanher617/microsoft-authentication-library-for-js that referenced this pull request Jan 4, 2022
Preserve ES modules and enable treeshaking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-browser Related to msal-browser package msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce bundle size
6 participants