@seayoo-web/scripts 2.0.8 → 2.0.9
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 +5 -4
- package/package.json +1 -1
- package/types/src/vite.page.d.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -146,8 +146,9 @@ function definePageBuildConfig(option) {
|
|
|
146
146
|
const { alias, ...resolveReset } = resolve;
|
|
147
147
|
return async function({ command, mode }) {
|
|
148
148
|
var _a;
|
|
149
|
-
const
|
|
150
|
-
const
|
|
149
|
+
const justBuild = onlyBuild || command === "build";
|
|
150
|
+
const envs = getBuildEnv(command, mode, justBuild);
|
|
151
|
+
const gitInfo = justBuild ? null : await getCommitInfo(command, mode, envs.page, envs.deployTo || "");
|
|
151
152
|
const isProductMode = mode === "production" || mode === "prod";
|
|
152
153
|
const trunkMap = {
|
|
153
154
|
...manualChunks,
|
|
@@ -215,7 +216,7 @@ function definePageBuildConfig(option) {
|
|
|
215
216
|
...define
|
|
216
217
|
}),
|
|
217
218
|
...plugins,
|
|
218
|
-
command === "build" && envs.deployTo && !
|
|
219
|
+
command === "build" && envs.deployTo && !justBuild && gitInfo ? viteDeployPlugin({
|
|
219
220
|
deployTo: envs.deployTo,
|
|
220
221
|
// 忽略 js sourcemap 文件
|
|
221
222
|
ignoreFiles: ["*.js.map"],
|
|
@@ -229,7 +230,7 @@ function definePageBuildConfig(option) {
|
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
232
|
}) : null,
|
|
232
|
-
command === "build" && envs.sentryAuthToken && !
|
|
233
|
+
command === "build" && envs.sentryAuthToken && !justBuild ? sentryVitePlugin({
|
|
233
234
|
authToken: envs.sentryAuthToken,
|
|
234
235
|
org: "sentry",
|
|
235
236
|
url: sentry.url || "https://sentry.seayoo.com/",
|
package/package.json
CHANGED
package/types/src/vite.page.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ interface ExternalConfig {
|
|
|
10
10
|
/**
|
|
11
11
|
* 手工指定 trunk 合并策略,Record<key, chunk>,即 id.include(key) 则打到 trunk 中
|
|
12
12
|
*
|
|
13
|
-
* 默认 {
|
|
13
|
+
* 默认 {`naive-ui`, `html2canvas`, `thinkingdata`, `vue`, node_modules: `vendor`}
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* 设置的值会跟默认值进行合并。其中 `vue` trunk 的实际包含了 `pinia` `vue-router` 在内的多个工具包
|
|
16
16
|
*
|
|
17
|
-
* 也可以手工设定 build.rollupOptions.output.manualChunks 来自定义
|
|
17
|
+
* 也可以手工设定 `build.rollupOptions.output.manualChunks` 来自定义
|
|
18
18
|
*/
|
|
19
19
|
manualChunks?: Record<string, string>;
|
|
20
20
|
}
|