vite-plugin-xq-cp-dep 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#vite-plugin-xq-cp-dep
|
|
1
|
+
# vite-plugin-xq-cp-dep
|
|
2
2
|
|
|
3
3
|
A vite copy all package.json config item 'dependencies' to public directory plugin.
|
|
4
4
|
|
|
5
5
|
一个将package.json配置文件中配置的'dependencies'的所有依赖包自动复制到public目录的插件。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 安装
|
|
8
8
|
```bash
|
|
9
9
|
|
|
10
10
|
npm i -D vite-plugin-xq-cp-dep
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
|
|
13
|
+
## 使用
|
|
14
14
|
Add plugin to your `vite.config.ts`:
|
|
15
15
|
在vite.config.ts引入插件:
|
|
16
16
|
|
|
@@ -25,7 +25,7 @@ export default defineConfig({
|
|
|
25
25
|
}
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
## 工作原理
|
|
29
29
|
|
|
30
30
|
package.json配置示例:
|
|
31
31
|
|
|
@@ -52,10 +52,16 @@ package.json配置示例:
|
|
|
52
52
|
<meta charset="utf-8">
|
|
53
53
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
54
54
|
<title>标题</title>
|
|
55
|
-
<link rel="stylesheet" href="
|
|
56
|
-
<link rel="stylesheet" href="
|
|
57
|
-
<script type="text/javascript" src="
|
|
55
|
+
<link rel="stylesheet" href="/bootstrap/dist/css/bootstrap.min.css">
|
|
56
|
+
<link rel="stylesheet" href="/bootstrap-icons/font/bootstrap-icons.css">
|
|
57
|
+
<script type="text/javascript" src="/bootstrap/dist/js/bootstrap.js"></script>
|
|
58
58
|
</head>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
因为bootstrap和bootstrap-icons的文件都已经复制到public目录下,因此可以直接使用。
|
|
61
|
+
因为bootstrap和bootstrap-icons的文件都已经复制到public目录下,因此可以直接使用。
|
|
62
|
+
另外public是公共目录,在页面引用的路径中无需写上public。
|
|
63
|
+
|
|
64
|
+
# 备注说明
|
|
65
|
+
|
|
66
|
+
### 如果复制的目录目标目录已经存在,将会跳过操作。
|
|
67
|
+
### 例如:复制'node_modules/bootstrap'目录到public目录下时,'public/bootstrap'目录已经存在,将会被跳过。如果需要更新,则需要将'public/bootstrap'手动删除。
|
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED