@seayoo-web/scripts 1.2.11 → 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 +28 -0
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/src/vite.app.d.ts +1 -1
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
package/types/index.d.ts
CHANGED
package/types/src/vite.app.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { type UserConfig } from "vite";
|
|
|
2
2
|
/**
|
|
3
3
|
* 导出一个动态的配置工厂函数
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function defineAppBuildConfig(option?: UserConfig): import("vite").UserConfigFnPromise;
|