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

chore: use webpack build compatible umd #5735

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

miracles1919
Copy link
Contributor

ref: #5571

试了一下不支持 globalThis 的浏览器(如,IOS 9)

  • globalThis 报错
  • typeof globalThis 返回 undefined

然后看下用 vite/webpack 打包出来的产物

  • vite
// development
var __read$7 = globalThis && globalThis.__read || ... 
var __spread$2 = globalThis && globalThis.__spread || ... 
  • webpack
// development
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();

所以这里将 compatible umd 改成用 webpack 构建


另外发现有些三方包的产物是 .mjs (如 @floating-ui/dom),babel-loader 里也要匹配进来

@github-actions
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-5735.surge.sh

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Base: 90.02% // Head: 89.91% // Decreases project coverage by -0.11% ⚠️

Coverage data is based on head (2ca2a76) compared to base (a001bdd).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5735      +/-   ##
==========================================
- Coverage   90.02%   89.91%   -0.12%     
==========================================
  Files         297      297              
  Lines        6339     6339              
  Branches     1554     1554              
==========================================
- Hits         5707     5700       -7     
- Misses        584      590       +6     
- Partials       48       49       +1     
Impacted Files Coverage Δ
src/components/image-uploader/image-uploader.tsx 86.36% <0.00%> (-6.37%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zombieJ zombieJ merged commit 8950f93 into ant-design:master Oct 17, 2022
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

2 participants