owntone-server/web-src/vite.config.js

40 lines
952 B
JavaScript
Raw Normal View History

2022-02-19 00:18:01 -05:00
import { defineConfig } from 'vite'
import i18n from '@intlify/unplugin-vue-i18n/vite'
2024-04-21 11:44:55 -04:00
import path from 'path'
import vue from '@vitejs/plugin-vue'
2022-02-19 00:18:01 -05:00
/*
* In development mode, use the VITE_OWNTONE_URL environment variable to set
* the remote OwnTone server URL. For example:
*
* export VITE_OWNTONE_URL=http://owntone.local:3689; npm run serve
*/
2024-04-27 01:00:08 -04:00
const target = process.env.VITE_OWNTONE_URL ?? 'http://localhost:3689'
2022-02-19 00:18:01 -05:00
export default defineConfig({
build: {
outDir: '../htdocs',
rollupOptions: {
output: {
2024-04-26 17:09:45 -04:00
assetFileNames: `assets/[name].[ext]`,
2022-02-19 00:18:01 -05:00
chunkFileNames: `assets/[name].js`,
2024-04-26 17:09:45 -04:00
entryFileNames: `assets/[name].js`
2022-02-19 00:18:01 -05:00
}
}
},
2024-04-26 17:09:45 -04:00
plugins: [
vue(),
i18n({
include: path.resolve(__dirname, './src/i18n/**.json')
})
],
resolve: { alias: { '@': '/src' } },
2022-02-19 00:18:01 -05:00
server: {
proxy: {
2024-04-27 01:00:08 -04:00
'/api': { target },
'/artwork': { target },
'/stream.mp3': { target }
2022-02-19 00:18:01 -05:00
}
}
})