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

fix(v2): fix babel transpilation include/exclude logic #1868

Merged
merged 4 commits into from
Oct 22, 2019
Merged

Conversation

endiliey
Copy link
Contributor

@endiliey endiliey commented Oct 21, 2019

Motivation

Previously, there is an edge case bug in which if website path contains docusaurus in its name, all the node_modules js file will be transpiled.

Example: /mnt/c/Users/endij/Desktop/Linux/test/docusaurus_crash/website/node_modules/@docusaurus/core/node_modules/core-js/modules/_descriptors.js will match the regex

Due to babel smart polyfilling, transpiling files like above that uses commonjs will cause webpack/webpack#4039 (comment)

TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

image

image

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

Using regextester. Only docusaurus npm package that are transpiled.

image

Manually patch new inited site with docusaurus on its name
image

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 21, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 21, 2019

Deploy preview for docusaurus-2 ready!

Built with commit 75429da

https://deploy-preview-1868--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 21, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 75429da

https://deploy-preview-1868--docusaurus-preview.netlify.com

@endiliey endiliey merged commit 4c4e6ad into master Oct 22, 2019
@endiliey endiliey deleted the endi/fix-babel branch October 22, 2019 05:17
parkas2018 added a commit to parkas2018/docusaurus that referenced this pull request Dec 17, 2019
This reverts all of the changes in previou commits. As per discussions
in PR facebook#1868, we need a different approach for this fix. So, reverting
the current changes and will start from scratch again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants