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 loading modules with AMD defines #1285

Merged
merged 1 commit into from
May 4, 2018
Merged

Fix loading modules with AMD defines #1285

merged 1 commit into from
May 4, 2018

Conversation

devongovett
Copy link
Member

Some UMD modules like moment-timezone have their AMD check before the CommonJS one. When an AMD loader like RequireJS is on the page, this causes the module to call define instead of exposing the exports to Parcel via CommonJS.

This PR sets define to undefined inside modules so that the AMD check will not pass and the exports will be exposed to CommonJS instead.

@codecov-io
Copy link

codecov-io commented May 4, 2018

Codecov Report

Merging #1285 into master will increase coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1285      +/-   ##
==========================================
+ Coverage   89.03%   89.28%   +0.25%     
==========================================
  Files          80       80              
  Lines        4577     4544      -33     
==========================================
- Hits         4075     4057      -18     
+ Misses        502      487      -15
Impacted Files Coverage Δ
src/visitors/globals.js 94.73% <100%> (+0.29%) ⬆️
src/assets/JSAsset.js 95.68% <100%> (ø) ⬆️
src/worker.js 95.23% <0%> (-4.77%) ⬇️
src/assets/CSSAsset.js 82.72% <0%> (-4.55%) ⬇️
src/Logger.js 95.78% <0%> (-1.06%) ⬇️
src/utils/loadPlugins.js 90.47% <0%> (+11.9%) ⬆️
src/assets/WebManifestAsset.js 78.57% <0%> (+19.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57be4e6...523407f. Read the comment docs.

@devongovett devongovett merged commit 674b17d into master May 4, 2018
@devongovett devongovett deleted the define-amd branch May 4, 2018 00:08
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.

2 participants