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

Analyze bundle size & decrease the size of main.js #248

Merged
merged 8 commits into from
Dec 18, 2018

Conversation

patw0929
Copy link
Owner

  • Install webpack-bundle-analyzer to get visualize size of webpack bundle file.
  • Install babel-plugin-transform-react-remove-prop-types to remove react-style-proptype in production.
  • Decrease main.js size from:
    image
    to
    image

@coveralls
Copy link

coveralls commented Dec 17, 2018

Coverage Status

Coverage remained the same at 94.158% when pulling 1e13731 on feature/analyze-bundle-size into 375c6bc on master.

openAnalyzer: true,
generateStatsFile: false,
statsFilename: 'stats.json',
statsOptions: null,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default it's null. We can omit this

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Fixed.

defaultSizes: 'parsed',
openAnalyzer: true,
generateStatsFile: false,
statsFilename: 'stats.json',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As generateStatsFile is false it wont create a file name stats.json

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@patw0929 patw0929 changed the base branch from feature/remove-libphonenumber to master December 17, 2018 12:08
@patw0929 patw0929 changed the title Analyze bundle size (rebase & revise base after #247 got merged) Analyze bundle size & decrease the size of main.js Dec 17, 2018
Copy link
Collaborator

@nutboltu nutboltu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

.babelrc Outdated
@@ -5,7 +5,16 @@
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
"@babel/plugin-syntax-dynamic-import",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be added to

"env": {
  "production": {
    "plugins": [...]
  }
}

?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomegz Do you mean @babel/plugin-syntax-dynamic-import or transform-react-remove-prop-types? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry i made it unclear. I meant transform-react-remove-prop-types - just wondering if it works correctly now

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. transform-react-remove-prop-types should be place in production part.
I already modified it. Thanks!

@patw0929 patw0929 merged commit 86aa5c2 into master Dec 18, 2018
@patw0929 patw0929 deleted the feature/analyze-bundle-size branch December 18, 2018 10:54
andrewsantarin pushed a commit to andrewsantarin/react-intl-tel-input that referenced this pull request Feb 2, 2022
…size

Analyze bundle size & decrease the size of main.js
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.

None yet

4 participants