-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
257 lines (240 loc) · 6.47 KB
/
nuxt.config.js
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
import webpack from 'webpack'
import getSiteMeta from './assets/js/utils/getSiteMeta'
const meta = getSiteMeta()
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0
const v = c === 'x' ? r : (r & 0x3) | 0x8
return v.toString(16)
})
}
export default {
version: uuidv4(),
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
// title: '',
// titleTemplate: 'Auratyk | %s',
title: 'Auratyk',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'format-detection', content: 'telephone=no' },
...meta,
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
hid: 'canonical',
rel: 'canonical',
href: process.env.BASE_URL,
},
],
script: [
{
src: 'https://unpkg.com/codyhouse-framework/main/assets/js/util.js',
async: true,
},
],
htmlAttrs: {
class: 'js',
},
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['@/assets/scss/_base.scss', '@/assets/scss/app.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
// Auto import components: https://go.nuxtjs.dev/config-components
components: [
{
path: '@/components',
extensions: ['vue'],
},
{
path: '@/assets/icons',
prefix: 'icon',
extensions: ['vue'],
},
{
path: '@/components/app',
prefix: 'app',
extensions: ['vue'],
},
{
path: '@/components/elements',
prefix: 'e',
extensions: ['vue'],
},
{
path: '@/components/blocks',
prefix: 'block',
extensions: ['vue'],
},
{
path: '@/components/webgl',
prefix: 'webgl',
extensions: ['vue'],
},
{
path: '@/components/svg',
prefix: 'svg',
extensions: ['vue'],
},
],
pageTransition: {
name: 'page',
mode: 'out-in',
beforeLeave(el) {
// console.log('Before leave...')
this.$events.emit('cursor:enter', { type: 'default' })
},
leave(el) {
// console.log('leave...')
this.$events.emit('scroller:reset')
},
afterLeave(el) {
// console.log('After leave...')
},
beforeEnter(el) {
// console.log('Before enter...')
},
enter(el) {
// console.log('Enter...', el)
},
afterEnter(el) {
// console.log('After enter...')
},
},
loading: false,
image: {
// Options
},
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/eslint
// '@nuxtjs/eslint-module',
// https://www.npmjs.com/package/@nuxtjs/style-resources
'@nuxt/image',
'@nuxtjs/style-resources',
],
styleResources: {
scss: [
'~assets/scss/shared/_mixins.scss',
'~assets/scss/shared/_breakpoints.scss',
'~assets/scss/shared/_media.scss',
],
hoistUseStatements: true, // Hoists the "@use" imports. Applies only to "sass", "scss" and "less". Default: false.
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// https://go.nuxtjs.dev/content
'@nuxt/content',
// '@nuxtjs/style-resources',
'nuxt-mq',
'nuxt-helmet',
'nuxt-ssr-cache',
'nuxt-compress',
'@nuxtjs/google-fonts',
],
googleFonts: {
families: {
'Space+Grotesk': [300, 400, 700],
'Space+Mono': [100, 300],
},
prefetch: true,
preconnect: true,
preload: true,
display: 'swap',
},
mq: {
defaultBreakpoint: 'default',
breakpoints: {
mobile: 769,
desktop: Infinity,
},
},
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL:
process.env.NODE_ENV === 'development'
? 'http://localhost:3000'
: 'https://auratyk.com', // Used as fallback if no runtime config is provided
},
publicRuntimeConfig: {
axios: {
browserBaseURL: process.env.BROWSER_BASE_URL,
},
},
privateRuntimeConfig: {
axios: {
baseURL: process.env.BASE_URL,
},
},
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en',
},
},
server: {
host: '0', // default: localhost
},
env: {
baseUrl: process.env.BASE_URL || 'http://localhost:3000',
staticForms: process.env.STATIC_FORMS_KEY,
sheetsEndpoint: process.env.SHEETS_CONTACT_ENDPOINT,
sheetsTabId: process.env.SHEETS_CONTACT_TAB_ID,
},
// Content module configuration: https://go.nuxtjs.dev/config-content
content: {},
plugins: [
{ src: '~/plugins/polyfills.js', mode: 'client' },
{ src: '~/plugins/events.js', mode: 'client' },
{ src: '~/plugins/frame.js', mode: 'client' },
{ src: '~/plugins/viewport.js', mode: 'client' },
{ src: '~/plugins/mouse.js', mode: 'client' },
{ src: '~/plugins/directives.js', mode: 'client' },
{ src: '~/plugins/gsap.js', mode: 'client' },
{ src: '~/plugins/three.js', mode: 'client' },
{ src: '~/plugins/auratyk-home.js', mode: 'client' },
{ src: '~/plugins/codyhouse-utils.js', mode: 'client' },
{ src: '~/plugins/soundReactor.js', mode: 'client' },
{ src: '~/plugins/loadingController.js', mode: 'client' },
{ src: '~/plugins/scrollHandlers.js', mode: 'client' },
{ src: '~/plugins/insights-analytics.js', mode: 'client' },
{ src: '~plugins/vue-js-modal.js', mode: 'client' },
],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
extend: (config) => {
config.plugins.push(new webpack.ProvidePlugin({ THREE: 'three' }))
config.module.rules.push({
test: /\.(glsl|vs|fs|vert|frag)$/,
exclude: /node_modules/,
use: ['raw-loader', 'glslify-loader'],
})
},
babel: {
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
],
presets({ isServer }) {
return [
[
'@babel/preset-env',
{
targets: '> 2%, not dead',
},
],
]
},
},
},
}