firefly-iii/vite.config.js

76 lines
2.2 KiB
JavaScript
Raw Normal View History

2023-09-19 23:36:43 -05:00
/*
* vite.config.js
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2023-07-11 07:42:57 -05:00
import {defineConfig} from 'vite';
2023-07-11 04:45:55 -05:00
import laravel from 'laravel-vite-plugin';
2023-08-12 11:12:20 -05:00
import manifestSRI from 'vite-plugin-manifest-sri';
2023-07-11 04:45:55 -05:00
2023-08-06 00:02:55 -05:00
const host = '127.0.0.1';
2023-07-11 04:45:55 -05:00
2024-01-02 08:41:14 -06:00
function manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor';
}
};
2023-07-11 04:45:55 -05:00
export default defineConfig({
2024-01-02 08:41:14 -06:00
build: {
rollupOptions: {
output: {
manualChunks,
},
}
},
2023-07-11 04:45:55 -05:00
plugins: [
laravel({
input: [
2023-07-23 01:26:12 -05:00
'resources/assets/v2/sass/app.scss',
2023-08-22 01:28:52 -05:00
'resources/assets/v2/pages/dashboard/dashboard.js',
2024-03-04 13:41:34 -06:00
// accounts
'resources/assets/v2/pages/accounts/index.js',
// transactions
2023-10-08 09:21:09 -05:00
'resources/assets/v2/pages/transactions/create.js',
2024-01-03 12:34:50 -06:00
'resources/assets/v2/pages/transactions/edit.js',
'resources/assets/v2/pages/transactions/show.js',
2024-01-13 13:34:09 -06:00
'resources/assets/v2/pages/transactions/index.js',
2024-03-04 13:41:34 -06:00
],
2023-07-11 04:45:55 -05:00
refresh: true,
}),
2023-08-12 11:12:20 -05:00
manifestSRI(),
2024-01-02 08:41:14 -06:00
2023-07-11 04:45:55 -05:00
],
server: {
usePolling: true,
2024-02-10 01:28:59 -06:00
allowedHosts: '*.sd.internal',
2023-07-11 04:45:55 -05:00
host: '0.0.0.0',
2023-07-11 07:42:57 -05:00
hmr: {host},
2023-08-06 00:02:55 -05:00
cors: true
// https: {
// key: fs.readFileSync(`/Users/sander/Sites/vm/tls-certificates/wildcard.sd.local.key`),
// cert: fs.readFileSync(`/Users/sander/Sites/vm/tls-certificates/wildcard.sd.local.crt`),
// },
2023-07-11 04:45:55 -05:00
},
});