unplugin-env 1.0.3 → 1.0.4

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 CHANGED
@@ -151,6 +151,32 @@ build({
151
151
 
152
152
  <br></details>
153
153
 
154
+ ## Options
155
+
156
+ ```ts
157
+ Starter({
158
+ env: {
159
+ configDir: 'config',
160
+ emitFileName: 'manifest.js',
161
+ emitDir: 'assets',
162
+ globalName: 'manifest',
163
+ devMatch: /dev/i,
164
+ buildMatch: /prod/i,
165
+ },
166
+ compress: {
167
+ includeBaseDir: true,
168
+ },
169
+ })
170
+ ```
171
+
172
+ - `env.configDir`: directory to locate config files.
173
+ - `env.emitFileName`: output file name for the emitted asset and injected script.
174
+ - `env.emitDir`: subdirectory under the build output directory.
175
+ - `env.globalName`: global variable name on `window`.
176
+ - `env.devMatch`: regex to pick the dev config file.
177
+ - `env.buildMatch`: regex to pick the build config file.
178
+ - `compress.includeBaseDir`: keep the top-level folder inside the zip.
179
+
154
180
  ## System Requirements
155
181
 
156
182
  ### Runtime Environment
package/README.zh-CN.md CHANGED
@@ -153,6 +153,32 @@ build({
153
153
 
154
154
  <br></details>
155
155
 
156
+ ## 配置项
157
+
158
+ ```ts
159
+ Starter({
160
+ env: {
161
+ configDir: 'config',
162
+ emitFileName: 'manifest.js',
163
+ emitDir: 'assets',
164
+ globalName: 'manifest',
165
+ devMatch: /dev/i,
166
+ buildMatch: /prod/i,
167
+ },
168
+ compress: {
169
+ includeBaseDir: true,
170
+ },
171
+ })
172
+ ```
173
+
174
+ - `env.configDir`: 配置文件所在目录。
175
+ - `env.emitFileName`: 输出文件名(用于 emit 和注入脚本)。
176
+ - `env.emitDir`: 输出子目录(相对于构建输出目录)。
177
+ - `env.globalName`: 挂到 `window` 的全局变量名。
178
+ - `env.devMatch`: 匹配开发环境配置文件的正则。
179
+ - `env.buildMatch`: 匹配生产环境配置文件的正则。
180
+ - `compress.includeBaseDir`: 压缩时是否保留顶层目录。
181
+
156
182
  ## 系统要求详情
157
183
 
158
184
  ### 运行环境
@@ -5,7 +5,7 @@
5
5
 
6
6
  import {
7
7
  unpluginFactory
8
- } from "./chunk-IQADAXMX.js";
8
+ } from "./chunk-U46ND53S.js";
9
9
 
10
10
  // src/vite.ts
11
11
  import { createVitePlugin } from "unplugin";