unplugin-env 1.0.2 → 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/LICENSE +1 -1
- package/README.md +29 -0
- package/README.zh-CN.md +29 -0
- package/dist/{chunk-6I6MSMXF.js → chunk-C7PRSZM3.js} +1 -1
- package/dist/{chunk-V2T5VQQ7.js → chunk-U46ND53S.js} +537 -160
- package/dist/{chunk-664Z6SFJ.js → chunk-ZHT777ZG.js} +1 -1
- package/dist/esbuild.cjs +538 -161
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +538 -161
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +538 -161
- package/dist/nuxt.js +3 -3
- package/dist/rollup.cjs +538 -161
- package/dist/rollup.js +1 -1
- package/dist/types.d.cts +15 -7
- package/dist/types.d.ts +15 -7
- package/dist/vite.cjs +538 -161
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +538 -161
- package/dist/webpack.js +2 -2
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Nikkolast88 <https://github.com/nikkolast88>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# unplugin-env
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/unplugin-env)
|
|
4
|
+
[](https://github.com/Nikkolast88/unplugin-env/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/unplugin-env)
|
|
6
|
+
[](./LICENSE)
|
|
4
7
|
|
|
5
8
|
Starter template for [unplugin](https://github.com/unjs/unplugin).
|
|
6
9
|
|
|
@@ -148,6 +151,32 @@ build({
|
|
|
148
151
|
|
|
149
152
|
<br></details>
|
|
150
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
|
+
|
|
151
180
|
## System Requirements
|
|
152
181
|
|
|
153
182
|
### Runtime Environment
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# unplugin-env
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/unplugin-env)
|
|
4
|
+
[](https://github.com/Nikkolast88/unplugin-env/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/unplugin-env)
|
|
6
|
+
[](./LICENSE)
|
|
4
7
|
|
|
5
8
|
[unplugin](https://github.com/unjs/unplugin) 的入门模板。
|
|
6
9
|
|
|
@@ -150,6 +153,32 @@ build({
|
|
|
150
153
|
|
|
151
154
|
<br></details>
|
|
152
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
|
+
|
|
153
182
|
## 系统要求详情
|
|
154
183
|
|
|
155
184
|
### 运行环境
|