chore: typo
This commit is contained in:
parent
2972d0d400
commit
81a4f2d977
250
vite.config.ts
250
vite.config.ts
@ -41,7 +41,7 @@ function createFontMatcher(fontNames: string[]) {
|
|||||||
// The `match` option for the files of VitePluginInjectPreload
|
// The `match` option for the files of VitePluginInjectPreload
|
||||||
// matches the _output_ files.
|
// matches the _output_ files.
|
||||||
// Since we only want to mach variable fonts, we exploit here the fact
|
// Since we only want to mach variable fonts, we exploit here the fact
|
||||||
// that we added the `wght` term to indicate the variable weiht axis.
|
// that we added the `wght` term to indicate the variable weight axis.
|
||||||
// The format is something like:
|
// The format is something like:
|
||||||
// `/assets/OpenSans-Italic_wght__c9a8fe68-5f21f1e7.woff2`
|
// `/assets/OpenSans-Italic_wght__c9a8fe68-5f21f1e7.woff2`
|
||||||
// see: https://regex101.com/r/UgUWr1/1
|
// see: https://regex101.com/r/UgUWr1/1
|
||||||
@ -50,135 +50,135 @@ function createFontMatcher(fontNames: string[]) {
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
// https://vitest.dev/config/
|
// https://vitest.dev/config/
|
||||||
test: {
|
test: {
|
||||||
environment: 'happy-dom',
|
environment: 'happy-dom',
|
||||||
},
|
|
||||||
css: {
|
|
||||||
preprocessorOptions: {
|
|
||||||
scss: {
|
|
||||||
additionalData: PREFIXED_SCSS_STYLES,
|
|
||||||
charset: false, // fixes "@charset" must be the first rule in the file" warnings
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
postcss: {
|
css: {
|
||||||
plugins: [
|
preprocessorOptions: {
|
||||||
postcssEasings(),
|
scss: {
|
||||||
postcssEasingGradients(),
|
additionalData: PREFIXED_SCSS_STYLES,
|
||||||
|
charset: false, // fixes "@charset" must be the first rule in the file" warnings
|
||||||
|
},
|
||||||
|
},
|
||||||
|
postcss: {
|
||||||
|
plugins: [
|
||||||
|
postcssEasings(),
|
||||||
|
postcssEasingGradients(),
|
||||||
postcssPresetEnv(),
|
postcssPresetEnv(),
|
||||||
],
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
plugins: [
|
||||||
plugins: [
|
vue({
|
||||||
vue({
|
reactivityTransform: true,
|
||||||
reactivityTransform: true,
|
}),
|
||||||
}),
|
legacy,
|
||||||
legacy,
|
svgLoader({
|
||||||
svgLoader({
|
// Since the svgs are already manually optimized via https://jakearchibald.github.io/svgomg/
|
||||||
// Since the svgs are already manually optimized via https://jakearchibald.github.io/svgomg/
|
// we don't need to optimize them again.
|
||||||
// we don't need to optimize them again.
|
svgo: false,
|
||||||
svgo: false,
|
}),
|
||||||
}),
|
VueI18nPlugin({
|
||||||
VueI18nPlugin({
|
// TODO: only install needed stuff
|
||||||
// TODO: only install needed stuff
|
// Whether to install the full set of APIs, components, etc. provided by Vue I18n.
|
||||||
// Whether to install the full set of APIs, components, etc. provided by Vue I18n.
|
// By default, all of them will be installed.
|
||||||
// By default, all of them will be installed.
|
fullInstall: true,
|
||||||
fullInstall: true,
|
include: resolve(dirname(pathSrc), './src/i18n/lang/**'),
|
||||||
include: resolve(dirname(pathSrc), './src/i18n/lang/**'),
|
}),
|
||||||
}),
|
// https://github.com/Applelo/vite-plugin-inject-preload
|
||||||
// https://github.com/Applelo/vite-plugin-inject-preload
|
VitePluginInjectPreload({
|
||||||
VitePluginInjectPreload({
|
files: [{
|
||||||
files: [{
|
match: createFontMatcher(['Quicksand', 'OpenSans', 'OpenSans-Italic']),
|
||||||
match: createFontMatcher(['Quicksand', 'OpenSans', 'OpenSans-Italic']),
|
attributes: {crossorigin: 'anonymous'},
|
||||||
attributes: {crossorigin: 'anonymous'},
|
}],
|
||||||
}],
|
injectTo: 'custom',
|
||||||
injectTo: 'custom',
|
}),
|
||||||
}),
|
VitePWA({
|
||||||
VitePWA({
|
srcDir: 'src',
|
||||||
srcDir: 'src',
|
filename: 'sw.ts',
|
||||||
filename: 'sw.ts',
|
|
||||||
base: '/',
|
base: '/',
|
||||||
strategies: 'injectManifest',
|
strategies: 'injectManifest',
|
||||||
injectRegister: false,
|
injectRegister: false,
|
||||||
manifest: {
|
manifest: {
|
||||||
name: 'Vikunja',
|
name: 'Vikunja',
|
||||||
short_name: 'Vikunja',
|
short_name: 'Vikunja',
|
||||||
theme_color: '#1973ff',
|
theme_color: '#1973ff',
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
src: './images/icons/android-chrome-192x192.png',
|
src: './images/icons/android-chrome-192x192.png',
|
||||||
sizes: '192x192',
|
sizes: '192x192',
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: './images/icons/android-chrome-512x512.png',
|
src: './images/icons/android-chrome-512x512.png',
|
||||||
sizes: '512x512',
|
sizes: '512x512',
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: './images/icons/icon-maskable.png',
|
src: './images/icons/icon-maskable.png',
|
||||||
sizes: '1024x1024',
|
sizes: '1024x1024',
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
purpose: 'maskable',
|
purpose: 'maskable',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
start_url: '.',
|
start_url: '.',
|
||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
background_color: '#000000',
|
background_color: '#000000',
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
{
|
{
|
||||||
name: 'Overview',
|
name: 'Overview',
|
||||||
url: '/',
|
url: '/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Namespaces And Lists Overview',
|
name: 'Namespaces And Lists Overview',
|
||||||
short_name: 'Namespaces & Lists',
|
short_name: 'Namespaces & Lists',
|
||||||
url: '/namespaces',
|
url: '/namespaces',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Tasks Next Week',
|
name: 'Tasks Next Week',
|
||||||
short_name: 'Next Week',
|
short_name: 'Next Week',
|
||||||
url: '/tasks/by/week',
|
url: '/tasks/by/week',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Tasks Next Month',
|
name: 'Tasks Next Month',
|
||||||
short_name: 'Next Month',
|
short_name: 'Next Month',
|
||||||
url: '/tasks/by/month',
|
url: '/tasks/by/month',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Teams Overview',
|
name: 'Teams Overview',
|
||||||
short_name: 'Teams',
|
short_name: 'Teams',
|
||||||
url: '/teams',
|
url: '/teams',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
|
||||||
resolve: {
|
|
||||||
alias: [
|
|
||||||
{
|
|
||||||
find: '@',
|
|
||||||
replacement: pathSrc,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
resolve: {
|
||||||
},
|
alias: [
|
||||||
server: {
|
{
|
||||||
host: '127.0.0.1', // see: https://github.com/vitejs/vite/pull/8543
|
find: '@',
|
||||||
port: 4173,
|
replacement: pathSrc,
|
||||||
strictPort: true,
|
},
|
||||||
},
|
|
||||||
build: {
|
|
||||||
target: 'esnext',
|
|
||||||
rollupOptions: {
|
|
||||||
plugins: [
|
|
||||||
visualizer({
|
|
||||||
filename: 'stats.html',
|
|
||||||
gzipSize: true,
|
|
||||||
// template: 'sunburst',
|
|
||||||
// brotliSize: true,
|
|
||||||
}) as PluginOption,
|
|
||||||
],
|
],
|
||||||
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
host: '127.0.0.1', // see: https://github.com/vitejs/vite/pull/8543
|
||||||
|
port: 4173,
|
||||||
|
strictPort: true,
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
target: 'esnext',
|
||||||
|
rollupOptions: {
|
||||||
|
plugins: [
|
||||||
|
visualizer({
|
||||||
|
filename: 'stats.html',
|
||||||
|
gzipSize: true,
|
||||||
|
// template: 'sunburst',
|
||||||
|
// brotliSize: true,
|
||||||
|
}) as PluginOption,
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user