VueTorrent/vue.config.js

122 lines
3.4 KiB
JavaScript
Raw Normal View History

2020-09-12 19:51:17 +02:00
const webpack = require('webpack')
2021-02-07 03:45:59 -05:00
2021-04-15 23:22:47 +09:00
const iconVersion = 22 //fingerprint
2021-02-07 03:45:59 -05: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 03:45:59 -05:00
2019-12-09 14:20:09 +01:00
module.exports = {
pwa: {
2022-04-04 21:49:23 +02:00
manifestPath: 'manifest.json',
name: 'VueTorrent', //PWApp name
themeColor: '#597566', //PWA title bar color ( windows 10 PWA, android web browser and PWA address bar color )
manifestOptions: {
2021-04-15 23:22:47 +09:00
//start_url: 'https://example.com/',
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 23:22:47 +09: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 11:11:40 +01:00
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].title = 'VueTorrent'
2021-04-15 23:22:47 +09: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 13:24:23 +01:00
2020-12-30 11:11:40 +01:00
return args
})
},
outputDir: 'vuetorrent/public',
publicPath: './',
transpileDependencies: ['vuetify'],
configureWebpack: {
devtool: 'source-map',
plugins: [
2021-04-18 10:53:29 -04:00
new webpack.EnvironmentPlugin({
APPLICATION_VERSION: process.env['npm_package_version']
2020-12-30 11:11:40 +01:00
})
]
},
devServer: {
watchOptions: {
poll: true
2020-10-18 12:12:16 +02:00
},
2020-12-30 11:11:40 +01:00
host: '0.0.0.0',
2021-02-07 03:45:59 -05:00
port: `${vueTorrentPort}`,
disableHostCheck: true, //allows https proxy for dev server
2020-12-30 11:11:40 +01:00
proxy: {
'/api': {
target: `${proxyTarget}:${qBittorrentPort}`
2020-12-30 11:11:40 +01:00
}
2020-05-20 09:59:12 +02:00
}
2020-12-30 11:11:40 +01:00
}
2019-12-09 14:20:09 +01:00
}