2022-05-20 07:44:22 -04:00
|
|
|
import path from 'path'
|
2022-02-19 00:18:01 -05:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
2023-12-27 11:14:10 -05:00
|
|
|
import i18n from '@intlify/unplugin-vue-i18n/vite'
|
2022-02-19 00:18:01 -05:00
|
|
|
|
2023-12-15 11:53:17 -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
|
|
|
|
*/
|
2022-05-29 12:51:23 -04:00
|
|
|
const owntoneUrl = process.env.VITE_OWNTONE_URL ?? 'http://localhost:3689'
|
2022-03-19 13:35:32 -04:00
|
|
|
|
2022-02-19 00:18:01 -05:00
|
|
|
export default defineConfig({
|
|
|
|
resolve: { alias: { '@': '/src' } },
|
2022-05-20 07:44:22 -04:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
2023-12-27 11:14:10 -05:00
|
|
|
i18n({
|
2022-05-20 07:44:22 -04:00
|
|
|
include: path.resolve(__dirname, './src/locales/**')
|
|
|
|
})
|
|
|
|
],
|
2022-02-19 00:18:01 -05:00
|
|
|
build: {
|
|
|
|
outDir: '../htdocs',
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
entryFileNames: `assets/[name].js`,
|
|
|
|
chunkFileNames: `assets/[name].js`,
|
|
|
|
assetFileNames: `assets/[name].[ext]`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2022-03-19 13:35:32 -04:00
|
|
|
target: owntoneUrl
|
2022-02-19 00:18:01 -05:00
|
|
|
},
|
|
|
|
'/artwork': {
|
2022-03-19 13:35:32 -04:00
|
|
|
target: owntoneUrl
|
2022-02-19 00:18:01 -05:00
|
|
|
},
|
|
|
|
'/stream.mp3': {
|
2022-03-19 13:35:32 -04:00
|
|
|
target: owntoneUrl
|
2022-02-19 00:18:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|