chore: update build process

This commit is contained in:
2026-03-02 22:36:05 +02:00
parent c5b4348ac6
commit 9d18a990dc
3 changed files with 14 additions and 3 deletions

2
.gitignore vendored
View File

@@ -9,8 +9,6 @@
/node_modules/
/dist
/js
/css
.DS_Store
build/
tsconfig.app.tsbuildinfo

0
js/.gitkeep Normal file
View File

View File

@@ -1,5 +1,6 @@
import { createAppConfig } from '@nextcloud/vite-config'
import path from 'path'
import path from 'node:path'
import { existsSync, rmSync } from 'node:fs'
import { visualizer } from 'rollup-plugin-visualizer'
import checker from 'vite-plugin-checker'
@@ -37,6 +38,7 @@ export default createAppConfig(
user: path.resolve(path.join('src', 'user.ts')),
},
{
emptyOutputDirectory: false,
config: {
root: 'src',
resolve: {
@@ -46,6 +48,17 @@ export default createAppConfig(
},
},
plugins: [
{
name: 'clean-dist-js',
generateBundle() {
for (const dir of ['dist/js', 'dist/css']) {
const p = path.resolve(__dirname, dir)
if (existsSync(p)) {
rmSync(p, { recursive: true })
}
}
},
},
checker({
vueTsc: true,
}),