feat(store): 重构应用状态管理,移除旧的 app-store 并引入 app-store-auto-imports
This commit is contained in:
@@ -63,7 +63,7 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
dirs: [
|
||||
// 'src/utils',
|
||||
'src/composables',
|
||||
'src/stores',
|
||||
// 'src/stores',
|
||||
// 匹配所有 -auto-imports.ts / -auto-imports.tsx 结尾的文件
|
||||
'src/**/*-auto-imports.{ts,tsx}',
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { PluginOption } from 'vite';
|
||||
import { minify as minifyHtml } from 'html-minifier-terser';
|
||||
import { loadEnv } from 'vite';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
|
||||
function IndexHtmlPlugin(): PluginOption {
|
||||
return {
|
||||
@@ -25,4 +26,7 @@ function IndexHtmlPlugin(): PluginOption {
|
||||
};
|
||||
}
|
||||
|
||||
export default [IndexHtmlPlugin()] satisfies PluginOption[];
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
const env = loadEnv(_configEnv.mode, process.cwd());
|
||||
if (env.VITE_BUILD_MINIFY === 'true') return IndexHtmlPlugin();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import { loadEnv } from 'vite';
|
||||
|
||||
export default [
|
||||
// ...
|
||||
] satisfies PluginOption;
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
return [];
|
||||
const env = loadEnv(_configEnv.mode, process.cwd());
|
||||
console.debug(`env :>> `, env);
|
||||
// ...
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user