Fix: markdownlint MD012/MD019 errors in build-pattern-conversion-plan.md
- Removed extra blank lines at end of file to resolve MD012 (no-multiple-blanks) - Standardized heading spacing to resolve MD019 (no-multiple-space-atx) - Stripped trailing whitespace and ensured file ends with a single newline All changes maintain content integrity and bring the file into full markdownlint compliance.
This commit is contained in:
@@ -3,11 +3,79 @@ import { VitePWA } from "vite-plugin-pwa";
|
||||
import { createBuildConfig } from "./vite.config.common.mts";
|
||||
import { loadAppConfig } from "./vite.config.utils.mts";
|
||||
|
||||
export default defineConfig(async () => {
|
||||
export default defineConfig(async ({ mode }) => {
|
||||
const baseConfig = await createBuildConfig('web');
|
||||
const appConfig = await loadAppConfig();
|
||||
|
||||
// Environment-specific configuration based on mode
|
||||
const getEnvironmentConfig = (mode: string) => {
|
||||
switch (mode) {
|
||||
case 'production':
|
||||
return {
|
||||
// Production optimizations
|
||||
build: {
|
||||
minify: 'terser',
|
||||
sourcemap: false,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
vendor: ['vue', 'vue-router', 'pinia'],
|
||||
utils: ['luxon', 'ramda', 'zod'],
|
||||
crypto: ['@ethersproject/wallet', '@ethersproject/hdnode', 'ethereum-cryptography'],
|
||||
sql: ['@jlongster/sql.js', 'absurd-sql']
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
define: {
|
||||
__DEV__: false,
|
||||
__TEST__: false,
|
||||
__PROD__: true
|
||||
}
|
||||
};
|
||||
case 'test':
|
||||
return {
|
||||
// Test environment configuration
|
||||
build: {
|
||||
minify: false,
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
define: {
|
||||
__DEV__: false,
|
||||
__TEST__: true,
|
||||
__PROD__: false
|
||||
}
|
||||
};
|
||||
default: // development
|
||||
return {
|
||||
// Development configuration
|
||||
build: {
|
||||
minify: false,
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
define: {
|
||||
__DEV__: true,
|
||||
__TEST__: false,
|
||||
__PROD__: false
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const environmentConfig = getEnvironmentConfig(mode);
|
||||
|
||||
return mergeConfig(baseConfig, {
|
||||
...environmentConfig,
|
||||
// Server configuration inherited from base config
|
||||
// CORS headers removed to allow images from any domain
|
||||
plugins: [
|
||||
@@ -15,13 +83,13 @@ export default defineConfig(async () => {
|
||||
registerType: 'autoUpdate',
|
||||
manifest: appConfig.pwaConfig?.manifest,
|
||||
devOptions: {
|
||||
enabled: false
|
||||
enabled: mode === 'development'
|
||||
},
|
||||
workbox: {
|
||||
cleanupOutdatedCaches: true,
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
sourcemap: true,
|
||||
sourcemap: mode !== 'production',
|
||||
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024 // 10MB
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user