@seayoo-web/scripts 1.2.10 → 1.2.12

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
@@ -207,6 +207,33 @@ function definePageBuildConfig(option) {
207
207
  };
208
208
  });
209
209
  }
210
+ function defineAppBuildConfig(option) {
211
+ return defineConfig(async function() {
212
+ const { plugins = [], build = {}, resolve = {}, ...optionReset } = option || {};
213
+ const { alias, ...resolveReset } = resolve || {};
214
+ return {
215
+ base: "./",
216
+ build: {
217
+ emptyOutDir: true,
218
+ outDir: join(process.cwd(), "./dist"),
219
+ assetsDir: "assets",
220
+ reportCompressedSize: false,
221
+ sourcemap: false,
222
+ ...build
223
+ },
224
+ plugins: [vue(), ...plugins],
225
+ resolve: {
226
+ alias: {
227
+ "@": join(process.cwd(), "./src"),
228
+ ...alias
229
+ },
230
+ extensions: [".mts", ".mjs", ".ts", ".js"],
231
+ ...resolveReset
232
+ },
233
+ ...optionReset
234
+ };
235
+ });
236
+ }
210
237
  const vueEslintConfig = [
211
238
  pluginVue.configs["flat/essential"],
212
239
  vueTsConfigs.recommended,
@@ -267,6 +294,7 @@ const stylelintConfig = {
267
294
  };
268
295
  export {
269
296
  EnvPrefix,
297
+ defineAppBuildConfig,
270
298
  defineConfigWithVueTs,
271
299
  defineLibBuildConfig,
272
300
  definePageBuildConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "scripts for seayoo web monorepos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
package/types/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./src/vite.lab";
2
2
  export * from "./src/vite.page";
3
+ export * from "./src/vite.app";
3
4
  export * from "./src/inject";
4
5
  export * from "./src/env";
5
6
  export * from "./src/eslint";
@@ -0,0 +1,5 @@
1
+ import { type UserConfig } from "vite";
2
+ /**
3
+ * 导出一个动态的配置工厂函数
4
+ */
5
+ export declare function defineAppBuildConfig(option?: UserConfig): import("vite").UserConfigFnPromise;