@seayoo-web/scripts 2.6.3 → 2.7.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/dist/index.js CHANGED
@@ -174,6 +174,7 @@ function definePageBuildConfig(option) {
174
174
  resolve = {},
175
175
  server = {},
176
176
  sentry = {},
177
+ envTransform,
177
178
  base,
178
179
  ...optionReset
179
180
  } = option || {};
@@ -202,6 +203,9 @@ function definePageBuildConfig(option) {
202
203
  }
203
204
  process.exit(0);
204
205
  }
206
+ if (envTransform) {
207
+ envs.viteEnvs = await envTransform(envs.viteEnvs, mode);
208
+ }
205
209
  const trunkMap = {
206
210
  "naive-ui": "naive-ui",
207
211
  html2canvas: "html2canvas",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "2.6.3",
3
+ "version": "2.7.1",
4
4
  "description": "scripts for seayoo web repos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -45,6 +45,10 @@ interface ExternalConfig {
45
45
  * 从而这些包被误打入最终的产物中,无谓增加了包的体积。默认 `thinkingdata` 和 `@esotericsoftware/spine`
46
46
  */
47
47
  badPackages?: string[];
48
+ /**
49
+ * 动态修改环境变量
50
+ */
51
+ envTransform?: (env: Record<string, string>, mode: string) => Promise<Record<string, string>> | Record<string, string>;
48
52
  }
49
53
  /**
50
54
  * 导出一个动态的配置工厂函数