@seayoo-web/scripts 2.0.7 → 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 +8 -5
- package/package.json +2 -2
- 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,
|
|
@@ -173,7 +174,7 @@ function definePageBuildConfig(option) {
|
|
|
173
174
|
outDir: join(process.cwd(), "./dist"),
|
|
174
175
|
assetsDir: "assets",
|
|
175
176
|
reportCompressedSize: false,
|
|
176
|
-
sourcemap: command === "build" && !!envs.sentryAuthToken,
|
|
177
|
+
sourcemap: command === "build" && !!envs.sentryAuthToken ? "hidden" : false,
|
|
177
178
|
...build,
|
|
178
179
|
rollupOptions: {
|
|
179
180
|
output: {
|
|
@@ -215,8 +216,10 @@ 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,
|
|
221
|
+
// 忽略 js sourcemap 文件
|
|
222
|
+
ignoreFiles: ["*.js.map"],
|
|
220
223
|
user: envs.deployUser,
|
|
221
224
|
key: envs.deployKey,
|
|
222
225
|
debug: envs.deployDebug,
|
|
@@ -227,7 +230,7 @@ function definePageBuildConfig(option) {
|
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
232
|
}) : null,
|
|
230
|
-
command === "build" && envs.sentryAuthToken && !
|
|
233
|
+
command === "build" && envs.sentryAuthToken && !justBuild ? sentryVitePlugin({
|
|
231
234
|
authToken: envs.sentryAuthToken,
|
|
232
235
|
org: "sentry",
|
|
233
236
|
url: sentry.url || "https://sentry.seayoo.com/",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/scripts",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "scripts for seayoo web repos",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"terser": "^5.39.0",
|
|
51
51
|
"vite-plugin-stylelint": "^6.0.0",
|
|
52
52
|
"vite-plugin-vue-devtools": "^7.7.5",
|
|
53
|
-
"@seayoo-web/finder": "^2.0.
|
|
53
|
+
"@seayoo-web/finder": "^2.0.15"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/fs-extra": "^11.0.4",
|
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
|
}
|