chore: 修复 vite import css 失败问题

This commit is contained in:
wuduoyi 2022-07-07 17:25:03 +08:00 committed by RUNZE LU
parent a437917ee5
commit 95d2fc108f
2 changed files with 21 additions and 5 deletions

View File

@ -341,14 +341,14 @@ html 中引入:
js 中引入:
```js
import './node_modules/amis/lib/themes/cxd.css';
import './node_modules/amis/lib/helper.css';
import './node_modules/amis/sdk/iconfont.css';
// 或 import './node_modules/amis/lib/themes/antd.css';
import 'amis/lib/themes/cxd.css';
import 'amis/lib/helper.css';
import 'amis/sdk/iconfont.css';
// 或 import 'amis/lib/themes/antd.css';
```
> 上面只是示例,请根据自己的项目结构调整引用路径
> 如果要支持 IE 11 请引入 ./node_modules/amis/sdk/cxd-ie11.css但这样就没法支持 CSS 变量了
> 如果要支持 IE 11 请引入 amis/sdk/cxd-ie11.css但这样就没法支持 CSS 变量了
2. 渲染器使用配置主题

View File

@ -160,9 +160,25 @@
"require": "./lib/index.js",
"import": "./esm/index.js"
},
"./lib/helper.css": {
"require": "./lib/helper.css",
"import": "./lib/helper.css"
},
"./lib/themes/*": {
"require": "./lib/themes/*",
"import": "./lib/themes/*"
},
"./lib/*": {
"require": "./lib/*.js",
"import": "./esm/*.js"
},
"./sdk/*": {
"require": [
"./sdk/*"
],
"import": [
"./sdk/*"
]
}
},
"jest": {