2021-08-19 20:09:45 +02:00
|
|
|
import createVuePlugin from '@vitejs/plugin-vue'
|
2021-07-25 15:27:15 +02:00
|
|
|
const {VitePWA} = require('vite-plugin-pwa')
|
|
|
|
const path = require('path')
|
2021-07-25 16:02:49 +02:00
|
|
|
const {visualizer} = require('rollup-plugin-visualizer')
|
2021-07-25 15:27:15 +02:00
|
|
|
|
2021-08-23 18:39:11 +02:00
|
|
|
const pathSrc = path.resolve(__dirname, './src')
|
|
|
|
|
2021-09-24 20:08:48 +02:00
|
|
|
// the @use rules have to be the first in the compiled stylesheets
|
|
|
|
const SCSS_IMPORT_PREFIX = `@use "sass:math";
|
|
|
|
@import "${pathSrc}/styles/variables";`
|
|
|
|
|
2021-07-25 15:27:15 +02:00
|
|
|
module.exports = {
|
2021-08-23 18:39:11 +02:00
|
|
|
css: {
|
|
|
|
preprocessorOptions: {
|
2021-09-24 20:08:48 +02:00
|
|
|
scss: { additionalData: SCSS_IMPORT_PREFIX },
|
2021-08-23 18:39:11 +02:00
|
|
|
},
|
|
|
|
},
|
2021-07-25 15:27:15 +02:00
|
|
|
plugins: [
|
2021-08-19 20:09:45 +02:00
|
|
|
createVuePlugin({
|
|
|
|
template: {
|
|
|
|
compilerOptions: {
|
|
|
|
compatConfig: {
|
|
|
|
MODE: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
2021-07-25 15:27:15 +02:00
|
|
|
VitePWA({
|
2021-07-26 22:26:53 +02:00
|
|
|
srcDir: 'src',
|
|
|
|
filename: 'sw.js',
|
|
|
|
base: '/',
|
2021-07-25 15:27:15 +02:00
|
|
|
strategies: 'injectManifest',
|
|
|
|
injectRegister: false,
|
|
|
|
manifest: {
|
|
|
|
name: 'Vikunja',
|
|
|
|
short_name: 'Vikunja',
|
|
|
|
theme_color: '#1973ff',
|
|
|
|
icons: [
|
|
|
|
{
|
|
|
|
src: './images/icons/android-chrome-192x192.png',
|
|
|
|
sizes: '192x192',
|
|
|
|
type: 'image/png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: './images/icons/android-chrome-512x512.png',
|
|
|
|
sizes: '512x512',
|
|
|
|
type: 'image/png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: './images/icons/icon-maskable.png',
|
|
|
|
sizes: '1024x1024',
|
|
|
|
type: 'image/png',
|
|
|
|
purpose: 'maskable',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
start_url: '.',
|
|
|
|
display: 'standalone',
|
|
|
|
background_color: '#000000',
|
|
|
|
shortcuts: [
|
|
|
|
{
|
|
|
|
name: 'Overview',
|
|
|
|
url: '/',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Namespaces And Lists Overview',
|
|
|
|
short_name: 'Namespaces & Lists',
|
|
|
|
url: '/namespaces',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tasks Next Week',
|
|
|
|
short_name: 'Next Week',
|
|
|
|
url: '/tasks/by/week',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tasks Next Month',
|
|
|
|
short_name: 'Next Month',
|
|
|
|
url: '/tasks/by/month',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Teams Overview',
|
|
|
|
short_name: 'Teams',
|
|
|
|
url: '/teams',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: [
|
2021-08-19 20:09:45 +02:00
|
|
|
{
|
|
|
|
find: 'vue',
|
|
|
|
replacement: '@vue/compat',
|
|
|
|
},
|
2021-07-25 15:27:15 +02:00
|
|
|
{
|
|
|
|
find: '@',
|
|
|
|
replacement: path.resolve(__dirname, 'src'),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
port: 5000,
|
|
|
|
strictPort: true,
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
target: 'es2015',
|
|
|
|
rollupOptions: {
|
2021-08-17 21:17:31 +02:00
|
|
|
plugins: [
|
2021-08-20 15:17:19 +02:00
|
|
|
visualizer({
|
|
|
|
filename: 'stats.html',
|
|
|
|
}),
|
2021-07-25 16:02:49 +02:00
|
|
|
],
|
2021-07-25 15:27:15 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|