From 95d2fc108f4d05a5c228019411a1e03342839d5a Mon Sep 17 00:00:00 2001 From: wuduoyi Date: Thu, 7 Jul 2022 17:25:03 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=20vite=20import=20c?= =?UTF-8?q?ss=20=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/start/getting-started.md | 10 +++++----- packages/amis/package.json | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/zh-CN/start/getting-started.md b/docs/zh-CN/start/getting-started.md index 2298f67bc..b413abe87 100644 --- a/docs/zh-CN/start/getting-started.md +++ b/docs/zh-CN/start/getting-started.md @@ -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. 渲染器使用配置主题 diff --git a/packages/amis/package.json b/packages/amis/package.json index 7fb903f6c..f6506f693 100644 --- a/packages/amis/package.json +++ b/packages/amis/package.json @@ -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": {