@seayoo-web/scripts 3.0.3 → 3.0.5
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 +23 -21
- package/package.json +8 -8
- package/types/src/vite.page.d.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -242,27 +242,29 @@ function definePageBuildConfig(option) {
|
|
|
242
242
|
},
|
|
243
243
|
plugins: [
|
|
244
244
|
preset.ignoreVuePlugin ? null : vue(),
|
|
245
|
-
preset.ignorePolyfill ? null : legacy(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
245
|
+
preset.ignorePolyfill ? null : legacy(
|
|
246
|
+
preset.polyfill ?? {
|
|
247
|
+
targets: ["defaults", "> 0.1%", "last 5 versions and not dead"],
|
|
248
|
+
// https://github.com/vitejs/vite/blob/main/packages/plugin-legacy/src/index.ts#L170
|
|
249
|
+
// https://unpkg.com/browse/core-js@3.41.0/
|
|
250
|
+
additionalLegacyPolyfills: [
|
|
251
|
+
"regenerator-runtime/runtime",
|
|
252
|
+
"core-js/es/global-this",
|
|
253
|
+
"core-js/es/array/flat",
|
|
254
|
+
"core-js/es/array/flat-map",
|
|
255
|
+
"core-js/es/promise/all-settled",
|
|
256
|
+
"core-js/es/promise/any",
|
|
257
|
+
"core-js/es/symbol/iterator"
|
|
258
|
+
],
|
|
259
|
+
additionalModernPolyfills: [
|
|
260
|
+
"core-js/es/array/flat",
|
|
261
|
+
"core-js/es/array/flat-map",
|
|
262
|
+
"core-js/es/promise/all-settled",
|
|
263
|
+
"core-js/es/promise/any",
|
|
264
|
+
"core-js/es/symbol/iterator"
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
),
|
|
266
268
|
htmlInjectPlugin({
|
|
267
269
|
BUILD_TIME: envs.stamp,
|
|
268
270
|
BUILD_MODE: envs.mode,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/scripts",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "scripts for seayoo web repos",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sentry/vite-plugin": "^4.
|
|
37
|
-
"@vitejs/plugin-legacy": "^7.1
|
|
36
|
+
"@sentry/vite-plugin": "^4.1.1",
|
|
37
|
+
"@vitejs/plugin-legacy": "^7.2.1",
|
|
38
38
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
39
39
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
40
40
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"colors": "^1.4.0",
|
|
43
43
|
"commander": "^13.1.0",
|
|
44
44
|
"eslint-plugin-import": "^2.32.0",
|
|
45
|
-
"eslint-plugin-vue": "^
|
|
46
|
-
"fs-extra": "^11.3.
|
|
45
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
46
|
+
"fs-extra": "^11.3.1",
|
|
47
47
|
"html-minifier-terser": "^7.2.0",
|
|
48
|
-
"inquirer": "^12.
|
|
49
|
-
"jiti": "^2.
|
|
48
|
+
"inquirer": "^12.9.3",
|
|
49
|
+
"jiti": "^2.5.1",
|
|
50
50
|
"ora": "^8.2.0",
|
|
51
51
|
"postcss-html": "^1.8.0",
|
|
52
52
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/fs-extra": "^11.0.4",
|
|
60
60
|
"@types/html-minifier-terser": "^7.0.2",
|
|
61
|
-
"@types/node": "^22.
|
|
61
|
+
"@types/node": "^22.17.2",
|
|
62
62
|
"@typescript-eslint/utils": "^8.39.1",
|
|
63
63
|
"eslint": "^9.33.0",
|
|
64
64
|
"stylelint": "^16.23.1",
|
package/types/src/vite.page.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Options } from "@vitejs/plugin-legacy";
|
|
1
2
|
import type { UserConfig, UserConfigFnPromise } from "vite";
|
|
2
3
|
interface ExternalConfig {
|
|
3
4
|
/**
|
|
@@ -20,6 +21,10 @@ interface ExternalConfig {
|
|
|
20
21
|
* 是否忽略 polyfill
|
|
21
22
|
*/
|
|
22
23
|
ignorePolyfill?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 自定义 polyfill
|
|
26
|
+
*/
|
|
27
|
+
polyfill?: Options;
|
|
23
28
|
/**
|
|
24
29
|
* 指定哪些不够友好的包,这些包的 iife 或修改全局 windows 变量的行为导致默认 tree-shaking 策略失效
|
|
25
30
|
*
|