refactor: migrate part of the sass compilation to vite (#283)

* refactor: migrate part of the sass compilation to vite

now `bundled` option is deprecated

* fix: update build script

* chore: add a “type” field to the package.json file to resolve Vite’s complaints about CommonJS modules.
This commit is contained in:
Spedon
2024-02-22 23:44:16 +08:00
committed by GitHub
parent 53a44776de
commit 875113448b
8 changed files with 82 additions and 25 deletions

View File

@@ -4,17 +4,17 @@ import solidPlugin from 'vite-plugin-solid'
export default defineConfig({
plugins: [solidPlugin()],
build: {
outDir: './static',
outDir: './static/bundled',
watch: {
include: 'assets/ts/**'
include: 'assets/**'
},
rollupOptions: {
input: './assets/ts/main.tsx',
output: {
dir: './static/bundled/js',
format: 'es',
entryFileNames: '[name].js',
chunkFileNames: '[hash:6].js',
entryFileNames: 'js/[name].js',
chunkFileNames: 'js/[hash:6].js',
assetFileNames: '[ext]/[name].[ext]',
compact: true
}
},