Files
firefly-iii/resources/assets/v2/vite.config.js

78 lines
2.1 KiB
JavaScript
Raw Normal View History

2023-09-20 06:36:43 +02:00
/*
* vite.config.js
* Copyright (c) 2024 james@firefly-iii.org.
2023-09-20 06:36:43 +02:00
*
* 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-09-20 06:36:43 +02:00
*/
2023-07-11 14:42:57 +02:00
import {defineConfig} from 'vite';
2023-07-11 11:45:55 +02:00
import laravel from 'laravel-vite-plugin';
import manifestSRI from 'vite-plugin-manifest-sri';
2023-07-11 11:45:55 +02:00
2023-08-06 07:02:55 +02:00
const host = '127.0.0.1';
2023-07-11 11:45:55 +02:00
2024-01-02 15:41:14 +01:00
function manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor';
}
2024-03-10 16:52:59 +01:00
}
2024-01-02 15:41:14 +01:00
2023-07-11 11:45:55 +02:00
export default defineConfig({
base: './',
2024-01-02 15:41:14 +01:00
build: {
rollupOptions: {
output: {
manualChunks,
},
}
},
2023-07-11 11:45:55 +02:00
plugins: [
laravel({
input: [
2024-03-09 12:11:06 +01:00
// css
'src/sass/app.scss',
2024-03-09 12:11:06 +01:00
// dashboard
'src/pages/dashboard/dashboard.js',
2024-03-04 20:41:34 +01:00
// accounts
'src/pages/accounts/index.js',
2024-03-04 20:41:34 +01:00
// administrations
'src/pages/administrations/index.js',
'src/pages/administrations/create.js',
'src/pages/administrations/edit.js',
// transactions
'src/pages/transactions/create.js',
'src/pages/transactions/edit.js',
'src/pages/transactions/show.js',
'src/pages/transactions/index.js',
],
publicDirectory: '../../../public',
2023-07-11 11:45:55 +02:00
refresh: true,
}) //,
// manifestSRI(),
2024-01-02 15:41:14 +01:00
2023-07-11 11:45:55 +02:00
],
server: {
usePolling: true,
host: '10.0.0.15',
2023-07-11 11:45:55 +02:00
},
});