mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
refactor: migrate to vite for critical scss bundling, remove dart sass dependency
Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
@@ -4,21 +4,37 @@ import solidPlugin from 'vite-plugin-solid'
|
||||
export default defineConfig({
|
||||
plugins: [solidPlugin()],
|
||||
build: {
|
||||
outDir: './static/bundled',
|
||||
outDir: './',
|
||||
watch: process.env.DISABLE_WATCH
|
||||
? null
|
||||
: {
|
||||
include: 'assets/**'
|
||||
},
|
||||
rollupOptions: {
|
||||
input: './assets/ts/main.tsx',
|
||||
input: {
|
||||
main: './assets/ts/main.tsx',
|
||||
critical: './assets/ts/critical.ts'
|
||||
},
|
||||
output: {
|
||||
format: 'es',
|
||||
entryFileNames: 'js/[name].js',
|
||||
chunkFileNames: 'js/[hash:6].js',
|
||||
assetFileNames: '[ext]/[name].[ext]',
|
||||
entryFileNames: (chunkInfo) =>
|
||||
chunkInfo.name === 'critical'
|
||||
? 'assets/bundled/[name].js'
|
||||
: 'static/bundled/js/[name].js',
|
||||
chunkFileNames: 'static/bundled/js/[hash:6].js',
|
||||
assetFileNames: (assetInfo) =>
|
||||
assetInfo.names[0]?.startsWith('critical')
|
||||
? 'assets/bundled/[name].[ext]'
|
||||
: 'static/bundled/[ext]/[name].[ext]',
|
||||
compact: true
|
||||
}
|
||||
}
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
loadPaths: ['./assets/scss']
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user