ant-design/alias/cssinjs.js
二货爱吃白萝卜 3233ac498f
chore: umd version will try to reuse global @ant-design/cssinjs first (#46009)
* chore: alias of it

* chore: comment
2023-11-22 15:04:55 +08:00

20 lines
619 B
JavaScript

/* 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;