OpenXE/vite.config.js

30 lines
718 B
JavaScript
Raw Permalink Normal View History

2023-03-30 10:54:18 +02:00
// SPDX-FileCopyrightText: 2023 Andreas Palm
//
// SPDX-License-Identifier: AGPL-3.0-only
import glob from 'glob';
import path from 'path';
import vue from '@vitejs/plugin-vue';
const moduleInputs = glob.sync('classes/Modules/*/www/js/entry.{js,jsx}')
.map(file => ['modules/'+file.split('/')[2], file]);
/** @type {import('vite').UserConfig} */
export default {
build: {
rollupOptions: {
input: {
...Object.fromEntries(moduleInputs)
}
},
manifest: true,
outDir: 'www/dist',
},
plugins: [vue()],
mode: 'development',
resolve: {
alias: {
'@res': path.resolve(__dirname, 'resources')
}
}
}