import zipFolder from 'folder-zip-sync' import fs from 'fs' import path from 'path' import { fileURLToPath } from 'url' const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) if (!fs.existsSync(path.resolve(__dirname, '../war'))) { fs.mkdirSync(path.resolve(__dirname, '../war')) } zipFolder('./dist', `./war/test.war`)
npm install folder-zip-sync --save-dev
"build:war": "vite build && node ./build/war.js",