@seayoo-web/scripts 2.1.1 → 2.2.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 +6 -5
- package/package.json +2 -2
- package/types/src/vite.page.d.ts +13 -1
package/dist/index.js
CHANGED
|
@@ -134,7 +134,6 @@ function htmlInjectPlugin(data) {
|
|
|
134
134
|
}
|
|
135
135
|
function definePageBuildConfig(option) {
|
|
136
136
|
const {
|
|
137
|
-
onlyBuild,
|
|
138
137
|
manualChunks,
|
|
139
138
|
badPackages = [],
|
|
140
139
|
plugins = [],
|
|
@@ -147,14 +146,15 @@ function definePageBuildConfig(option) {
|
|
|
147
146
|
} = option || {};
|
|
148
147
|
const { alias, ...resolveReset } = resolve;
|
|
149
148
|
return async function({ command, mode }) {
|
|
150
|
-
var _a;
|
|
151
|
-
const justBuild =
|
|
149
|
+
var _a, _b, _c;
|
|
150
|
+
const justBuild = mode === "build";
|
|
152
151
|
const envs = getBuildEnv(command, mode, justBuild);
|
|
153
152
|
const gitInfo = justBuild ? null : await getCommitInfo(command, mode, envs.page, envs.deployTo || "");
|
|
154
153
|
const isProductMode = mode === "production" || mode === "prod";
|
|
155
154
|
const trunkMap = {
|
|
156
155
|
"naive-ui": "naive-ui",
|
|
157
156
|
html2canvas: "html2canvas",
|
|
157
|
+
swiper: "swiper",
|
|
158
158
|
...manualChunks
|
|
159
159
|
};
|
|
160
160
|
const trunkKeys = Object.keys(trunkMap);
|
|
@@ -220,10 +220,11 @@ function definePageBuildConfig(option) {
|
|
|
220
220
|
command === "build" && envs.deployTo && !justBuild && gitInfo ? viteDeployPlugin({
|
|
221
221
|
deployTo: envs.deployTo,
|
|
222
222
|
// 忽略 js sourcemap 文件
|
|
223
|
-
ignoreFiles: ["*.js.map"],
|
|
223
|
+
ignoreFiles: ["*.js.map", ...((_b = option == null ? void 0 : option.finder) == null ? void 0 : _b.ignoreFiles) || []],
|
|
224
224
|
user: envs.deployUser,
|
|
225
225
|
key: envs.deployKey,
|
|
226
226
|
debug: envs.deployDebug,
|
|
227
|
+
preview: ((_c = option == null ? void 0 : option.finder) == null ? void 0 : _c.preview) ?? true,
|
|
227
228
|
commitLogs: isProductMode && gitInfo.logs.length > 0 ? "\n" + gitInfo.logs.join("\n") : void 0,
|
|
228
229
|
onFinished() {
|
|
229
230
|
if (isProductMode) {
|
|
@@ -233,7 +234,7 @@ function definePageBuildConfig(option) {
|
|
|
233
234
|
}) : null,
|
|
234
235
|
command === "build" && envs.sentryAuthToken && !justBuild ? sentryVitePlugin({
|
|
235
236
|
authToken: envs.sentryAuthToken,
|
|
236
|
-
org: "sentry",
|
|
237
|
+
org: sentry.org || "sentry",
|
|
237
238
|
url: sentry.url || "https://sentry.seayoo.com/",
|
|
238
239
|
project: sentry.project || "gamer-fe"
|
|
239
240
|
}) : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/scripts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "scripts for seayoo web repos",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"terser": "^5.39.0",
|
|
52
52
|
"vite-plugin-stylelint": "^6.0.0",
|
|
53
53
|
"vite-plugin-vue-devtools": "^7.7.5",
|
|
54
|
-
"@seayoo-web/finder": "^2.0
|
|
54
|
+
"@seayoo-web/finder": "^2.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/fs-extra": "^11.0.4",
|
package/types/src/vite.page.d.ts
CHANGED
|
@@ -4,13 +4,25 @@ interface ExternalConfig {
|
|
|
4
4
|
sentry?: {
|
|
5
5
|
project?: string;
|
|
6
6
|
url?: string;
|
|
7
|
+
org?: string;
|
|
8
|
+
};
|
|
9
|
+
/** finder 配置 */
|
|
10
|
+
finder?: {
|
|
11
|
+
/** 是否部署完毕后打开目标文件(index.html)也可以指定不同的目标文件 */
|
|
12
|
+
preview?: boolean | string | string[];
|
|
13
|
+
/**
|
|
14
|
+
* 忽略部署的文件,如果是目录则需要以 / 结尾,支持 * 占位符模糊匹配。
|
|
15
|
+
*
|
|
16
|
+
* 匹配时仅针对单一目录和文件名进行检查,不跨目录检查
|
|
17
|
+
*/
|
|
18
|
+
ignoreFiles?: string[];
|
|
7
19
|
};
|
|
8
20
|
/** 仅仅编译 */
|
|
9
21
|
onlyBuild?: boolean;
|
|
10
22
|
/**
|
|
11
23
|
* 手工指定 trunk 合并策略,Record<key, chunk>,即 id.include(key) 则打到 trunk 中
|
|
12
24
|
*
|
|
13
|
-
* 默认 {`naive-ui`, `html2canvas`}
|
|
25
|
+
* 默认 {`naive-ui`, `html2canvas`, `swiper`}
|
|
14
26
|
*
|
|
15
27
|
* 设置的值会跟默认值进行合并。
|
|
16
28
|
*
|