-
Notifications
You must be signed in to change notification settings - Fork 15
/
nuxt.config.js
128 lines (125 loc) · 2.94 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
import webpack from 'webpack'
import buildModules from './configuration/nuxt/build-modules'
import modules from './configuration/nuxt/modules'
import head from './configuration/nuxt/head'
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: 'static',
...buildModules,
...modules,
...head,
generate: {
routes: [],
fallback: true
},
manifest: {
orientation: 'portrait-primary',
name: 'nuxt-three',
short_name: 'nuxt-three',
display: 'standalone',
background_color: '#000000',
theme_color: '#000000',
description: ''
},
components: [
{
path: '@/components',
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('Enter...')
this.$events.emit('scroller:reset')
},
afterLeave(el) {
// console.log('After leave...')
},
beforeEnter(el) {
// console.log('Before enter...')
},
enter(el) {
// console.log('Enter...')
},
afterEnter(el) {
// console.log('After enter...')
}
},
loading: false,
css:
process.env.NODE_ENV === 'development'
? ['@/assets/styles/debug.scss', '@/assets/styles/app.scss']
: ['@/assets/styles/app.scss'],
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' }
],
build: {
extend(config, ctx) {
config.plugins.push(new webpack.ProvidePlugin({ THREE: 'three' }))
config.module.rules.push({
test: /\.(glsl|vs|fs)$/,
loader: 'raw-loader'
})
},
babel: {
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/proposal-class-properties'
],
presets({ isServer }) {
return [
[
'@babel/preset-env',
{
targets: '> 2%, not dead'
}
]
]
}
}
}
}