VueTorrent/vue.config.js

117 lines
3.2 KiB
JavaScript
Raw Normal View History

2020-09-12 20:51:17 +03:00
const webpack = require('webpack')
2021-02-07 11:45:59 +03:00
2022-04-16 12:11:18 +03:00
const iconVersion = 22
2021-04-15 17:22:47 +03:00
2021-02-07 11:45:59 +03:00
const qBittorrentPort = process.env['QBITTORRENT_PORT'] ?? 8080
const vueTorrentPort = process.env['VUETORRENT_PORT'] ?? 8000
const proxyTarget = process.env['QBITTORRENT_TARGET'] ?? 'http://localhost'
2021-02-07 11:45:59 +03:00
2019-12-09 16:20:09 +03:00
module.exports = {
pwa: {
2022-04-04 22:49:23 +03:00
manifestPath: 'manifest.json',
2022-04-16 12:11:18 +03:00
name: 'VueTorrent',
themeColor: '#597566', //PWA title bar color ( windows 10 PWA, android web browser and PWA address bar color )
manifestOptions: {
2021-04-15 17:22:47 +03:00
icons: [
{
src: './icons/android-chrome-192x192.png?s=' + iconVersion,
sizes: '192x192',
type: 'image/png'
},
{
src: './icons/android-chrome-512x512.png?s=' + iconVersion,
sizes: '512x512',
type: 'image/png'
},
{
src: './icons/android-chrome-maskable-192x192.png?s=' + iconVersion,
sizes: '192x192',
type: 'image/png',
purpose: 'maskable'
},
{
src: './icons/android-chrome-maskable-512x512.png?s=' + iconVersion,
sizes: '512x512',
type: 'image/png',
purpose: 'maskable'
},
{
src: './icons/apple-touch-icon.png?s=' + iconVersion,
sizes: '180x180',
type: 'image/png'
},
{
src: './icons/safari-pinned-tab.svg?s=' + iconVersion,
sizes: '683x683',
type: 'image/svg+xml'
},
{
src: './icons/msapplication-icon-144x144.png?s=' + iconVersion,
sizes: '144x144',
type: 'image/png'
}
],
background_color: '#eeeeee' //background color for android PWA splash page
},
2021-04-15 17:22:47 +03:00
iconPaths: {
favicon: './favicon.ico?s=' + iconVersion,
favicon32: './icons/favicon-32x32.png?s=' + iconVersion,
favicon16: './icons/favicon-16x16.png?s=' + iconVersion,
appleTouchIcon: './icons/apple-touch-icon.png?s=' + iconVersion,
maskIcon: './icons/safari-pinned-tab.svg?s=' + iconVersion
},
workboxOptions: {
skipWaiting: true
}
},
2020-12-30 13:11:40 +03:00
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].title = 'VueTorrent'
2021-04-15 17:22:47 +03:00
args[0].meta = [
{
name: 'description',
content: 'The sleekest looking WEBUI for qBittorrent made with Vuejs!'
},
{
property: 'og:image',
content: './icons/android-chrome-maskable-512x512.png?s=' + iconVersion
},
{
property: 'og:description',
content: 'torrent universal server for remote download.'
},
{
property: 'og:title',
content: 'WELCOME :: VUE TORRENT'
}
]
2021-01-27 15:24:23 +03:00
2020-12-30 13:11:40 +03:00
return args
})
},
outputDir: 'vuetorrent/public',
publicPath: './',
transpileDependencies: ['vuetify'],
configureWebpack: {
devtool: 'source-map',
plugins: [
2021-04-18 17:53:29 +03:00
new webpack.EnvironmentPlugin({
APPLICATION_VERSION: process.env['npm_package_version']
2020-12-30 13:11:40 +03:00
})
]
},
devServer: {
host: '0.0.0.0',
2021-02-07 11:45:59 +03:00
port: `${vueTorrentPort}`,
2020-12-30 13:11:40 +03:00
proxy: {
'/api': {
target: `${proxyTarget}:${qBittorrentPort}`
2020-12-30 13:11:40 +03:00
}
2020-05-20 10:59:12 +03:00
}
2020-12-30 13:11:40 +03:00
}
2019-12-09 16:20:09 +03:00
}