webapp/app.config.ts

48 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-06-24 17:50:27 +00:00
import { SolidStartInlineConfig, defineConfig } from '@solidjs/start/config'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import sassDts from 'vite-plugin-sass-dts'
const isVercel = Boolean(process?.env.VERCEL)
2024-06-25 14:22:28 +00:00
const isBun = Boolean(process.env.BUN)
2024-06-24 17:50:27 +00:00
export default defineConfig({
2024-06-25 22:52:46 +00:00
ssr: true,
2024-06-24 17:50:27 +00:00
server: {
2024-06-25 14:22:28 +00:00
preset: isVercel ? 'vercel_edge' : isBun ? 'bun' : 'node',
2024-06-26 08:22:05 +00:00
port: 3000
2024-06-24 17:50:27 +00:00
},
2024-06-25 22:52:46 +00:00
devOverlay: true,
2024-06-24 17:50:27 +00:00
build: {
chunkSizeWarningLimit: 1024,
2024-06-26 08:22:05 +00:00
target: 'esnext'
2024-06-24 17:50:27 +00:00
},
vite: {
envPrefix: 'PUBLIC_',
plugins: [
nodePolyfills({
include: ['path', 'stream', 'util'],
exclude: ['http'],
globals: {
2024-06-26 08:22:05 +00:00
Buffer: true
2024-06-24 17:50:27 +00:00
},
overrides: {
2024-06-26 08:22:05 +00:00
fs: 'memfs'
2024-06-24 17:50:27 +00:00
},
2024-06-26 08:22:05 +00:00
protocolImports: true
2024-06-24 17:50:27 +00:00
}),
sassDts()
],
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "src/styles/imports";\n',
2024-06-26 08:22:05 +00:00
includePaths: ['./public', './src/styles']
}
}
2024-06-24 17:50:27 +00:00
},
build: {
chunkSizeWarningLimit: 1024,
2024-06-26 08:22:05 +00:00
target: 'esnext'
2024-06-24 17:50:27 +00:00
}
}
} as SolidStartInlineConfig)