-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
125 lines (103 loc) · 3.38 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// APP VERSION
// FILE METHOD
//const fs = require('fs')
//const packageJson = fs.readFileSync('./package.json')
//const version = JSON.parse(packageJson).version || 0
// PASSING THROUGH NPM SCRIPT (may have OS issues)
//"generateWeb": "NUXT_WTF=productionweb APP_VERSION=$npm_package_version nuxt generate",
//const version = process.env.APP_VERSION
// DIRECT (seems to work? it's the best)
//const version = JSON.stringify(process.env.npm_package_version)
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
vite: {
define: {
// TODO:
// FAILS
//APP_VERSION: process.env.npm_package_version
// WORKS
APP_VERSION: JSON.stringify(process.env.npm_package_version)
}
},
ssr: true,
app: {
head: {
meta: [
{ name: 'viewport', content: 'width=device-width, user-scalable=no, viewport-fit=cover' },
],
},
// TODO: Since we're using an "app.config.ts" (based on official recommendations), should we not put page transitions there too?
pageTransition: {
name: 'page',
mode: 'out-in' // Disabled this mode because it brings up errors especially when running animations on pages. However, looks like pages are cross-fading just fine without this???
},
baseURL: process.env.NUXT_WTF === 'productionweb' ? '/pictodice/' : '/'
},
css: ['@/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
//'tailwindcss/nesting': {}, // For nesting CSS classes. More info: https://tailwindcss.com/docs/using-with-preprocessors#nesting
}
},
modules: [
[
'@pinia/nuxt',
{ autoImports: ['defineStore', 'acceptHMRUpdate'] }
],
'@vite-pwa/nuxt',
'@vueuse/motion/nuxt',
'@nuxt/image-edge',
'@nuxtjs/color-mode'
],
runtimeConfig: {
ipx: {
//dir: path.resolve('./public'),
dir: '../../public/images',
//domains: [
// 'assets.mycompany.com',
//]
}
},
image: {
image: {
provider: 'ipx'
},
dir: 'public/images',
// Generate images to `/_nuxt/images/file.png`
//staticFilename: 'images/[name]-[hash][ext]'
},
colorMode: {
//preference: 'system',// default value of $colorMode.preference
//fallback: 'light', // fallback value if not system preference found
//hid: 'nuxt-color-mode-script',
//globalName: '__NUXT_COLOR_MODE__',
//componentName: 'ColorScheme',
classPrefix: 'ColorMode-',
classSuffix: '',
//storageKey: 'nuxt-color-mode'
},
//colorMode: {
// classSuffix: ''
//}, // FOR DARK MODE. Doing this allows Tailwind dark mode class to take effect.
// See: https://color-mode.nuxtjs.org/#tailwindcss
//modules: ['@pinia/nuxt'],
pwa: {
/* PWA options */
}
/*
imports: {
dirs: ['stores'],
},
*/
/*
pinia: {
autoImports: [
// automatically imports `defineStore`
'defineStore', // import { defineStore } from 'pinia'
['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
],
},
*/
})