@seayoo-web/scripts 2.0.12 → 2.1.0

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
@@ -1,5 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import vue from "@vitejs/plugin-vue";
3
+ import { visualizer } from "rollup-plugin-visualizer";
3
4
  import { viteDeployPlugin } from "@seayoo-web/finder";
4
5
  import { sentryVitePlugin } from "@sentry/vite-plugin";
5
6
  import legacy from "@vitejs/plugin-legacy";
@@ -25,7 +26,7 @@ function defineAppBuildConfig(option) {
25
26
  sourcemap: false,
26
27
  ...build
27
28
  },
28
- plugins: [vue(), ...plugins],
29
+ plugins: [vue(), (option == null ? void 0 : option.visualizer) ? visualizer() : null, ...plugins],
29
30
  resolve: {
30
31
  alias: {
31
32
  "@": join(process.cwd(), "./src"),
@@ -229,7 +230,8 @@ function definePageBuildConfig(option) {
229
230
  org: "sentry",
230
231
  url: sentry.url || "https://sentry.seayoo.com/",
231
232
  project: sentry.project || "gamer-fe"
232
- }) : null
233
+ }) : null,
234
+ justBuild ? visualizer() : null
233
235
  ],
234
236
  define: transformEnvs({
235
237
  BUILD_TIME: envs.stamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "2.0.12",
3
+ "version": "2.1.0",
4
4
  "description": "scripts for seayoo web repos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -47,6 +47,7 @@
47
47
  "jiti": "^2.4.2",
48
48
  "ora": "^8.2.0",
49
49
  "postcss-html": "^1.8.0",
50
+ "rollup-plugin-visualizer": "^5.14.0",
50
51
  "terser": "^5.39.0",
51
52
  "vite-plugin-stylelint": "^6.0.0",
52
53
  "vite-plugin-vue-devtools": "^7.7.5",
@@ -2,4 +2,6 @@ import type { UserConfig } from "vite";
2
2
  /**
3
3
  * 导出一个动态的配置工厂函数
4
4
  */
5
- export declare function defineAppBuildConfig(option?: UserConfig): UserConfig;
5
+ export declare function defineAppBuildConfig(option?: UserConfig & {
6
+ visualizer?: boolean;
7
+ }): UserConfig;
@@ -1,4 +1,4 @@
1
- import { type UserConfig } from "vite";
1
+ import type { UserConfig } from "vite";
2
2
  interface LibBuildOption {
3
3
  /** 输出目录,默认为 "dist" */
4
4
  outDir?: string;