vite-plugin-root-html 1.0.0 → 1.0.1
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 +30 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# vite-plugin-root-html
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
> 配置vite打包的根html文件,更改打包后的html文件路径与名称,目前仅支持默认配置(index.html在根目录)
|
|
8
|
+
> 或者 在rollupOptions 配置的 单文件入口 `input: "src/Hello.html"`
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
rollupOptions: {
|
|
12
|
+
input: "src/Hello.html",
|
|
13
|
+
output: {
|
|
14
|
+
entryFileNames(chunkInfo) {
|
|
15
|
+
return "js/[name]-[hash].js"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install vite-plugin-root-html --save-dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 使用
|
|
28
|
+
`plugins: [vitePluginRootHtml({fileName: "xxx.html"})],`
|
|
29
|
+
|
|
30
|
+
`plugins: [vitePluginRootHtml({fileName: "page/xxx.html"})]`
|