forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: umd version will try to reuse global
@ant-design/cssinjs
fir…
…st (ant-design#46009) * chore: alias of it * chore: comment
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-disable global-require, import/no-unresolved */ | ||
|
||
// This is a alias proxy, which will use global `@ant-design/cssinjs` first. | ||
// Use local if global not found. | ||
let cssinjs; | ||
|
||
if (typeof window !== 'undefined' && window.antdCssinjs) { | ||
// Use window UMD version | ||
cssinjs = window.antdCssinjs; | ||
} else if (typeof global !== 'undefined' && global.antdCssinjs) { | ||
// Use global UMD version | ||
cssinjs = global.antdCssinjs; | ||
} else { | ||
// Use local version. | ||
// Use relative path since webpack will also replace module here. | ||
cssinjs = require('../node_modules/@ant-design/cssinjs'); | ||
} | ||
|
||
module.exports = cssinjs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters