Skip to content

Commit

Permalink
fix(module-tools): update umd global code (#4825)
Browse files Browse the repository at this point in the history
  • Loading branch information
targeral authored Oct 24, 2023
1 parent c90a91a commit 0b9e483
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/six-berries-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/module-tools': patch
---

feat(module-tools): update umd global code
feat(module-tools): 更新 umd 全局代码
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export const adapterPlugin = (compiler: ICompiler): Plugin => {
if (args.namespace === globalNamespace) {
const value = config.umdGlobals[args.path];
return {
contents: `module.exports = (typeof globalThis !== "undefined" ? globalThis : Function('return this')() || global || self)[${JSON.stringify(
contents: `module.exports = (typeof globalThis !== "undefined" ? globalThis : (typeof global !== "undefined" ? global : self || Function('return this')()))[${JSON.stringify(
value,
)}]`,
};
Expand Down

0 comments on commit 0b9e483

Please sign in to comment.