-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.js
More file actions
147 lines (142 loc) · 4.71 KB
/
nuxt.config.js
File metadata and controls
147 lines (142 loc) · 4.71 KB
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
const URL = require('url').URL
// const i18n = require('./i18n')
const fr = require('vuetify/es5/locale/fr').default
const en = require('vuetify/es5/locale/en').default
let config = require('config')
config.basePath = new URL(config.publicUrl + '/').pathname
// config.i18nMessages = i18n.messages
if (process.env.NODE_ENV === 'production') {
const nuxtConfigInject = require('@koumoul/nuxt-config-inject')
if (process.argv.slice(-1)[0] === 'build') config = nuxtConfigInject.prepare(config)
else nuxtConfigInject.replace(config, ['nuxt-dist/**/*', 'public/static/**/*'])
}
const webpack = require('webpack')
module.exports = {
ssr: false,
components: true,
srcDir: 'public/',
buildDir: 'nuxt-dist',
build: {
// cache: true,
publicPath: config.publicUrl + '/_nuxt/',
transpile: ['vuetify/lib', /@koumoul/], // Necessary for "à la carte" import of vuetify components
extend (config, { isServer, isDev, isClient }) {
// Ignore all locale files of moment.js, those we want are loaded in plugins/moment.js
config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
},
loaders: {
vue: {
compiler: require('vue-template-babel-compiler'),
},
},
},
loading: { color: '#1e88e5' }, // Customize the progress bar color
plugins: [
{ src: '~plugins/session' },
{ src: '~plugins/dayjs' },
{ src: '@/plugins/vue-clipboard2', ssr: false },
// { src: '~plugins/global-components' },
// { src: '~plugins/ws', ssr: false },
// { src: '~plugins/moment' },
// { src: '~plugins/truncate' },
// { src: '~plugins/cell-values' },
// { src: '~plugins/display-bytes' },
// { src: '~plugins/logger', ssr: false },
// { src: '~plugins/analytics', ssr: false },
// { src: '~plugins/polyfill', ssr: false },
],
router: {
base: config.basePath,
},
modules: ['@nuxtjs/axios', 'cookie-universal-nuxt'],
// modules: ['@digibytes/markdownit', ['nuxt-i18n', {
// seo: false,
// locales: [{ code: 'fr', iso: 'fr-FR' }, { code: 'en', iso: 'es-US' }],
// defaultLocale: 'fr',
// vueI18n: {
// fallbackLocale: 'fr',
// messages: config.i18nMessages,
// },
// }]],
axios: {
browserBaseURL: config.basePath,
// baseURL: `http://localhost:${config.port}/`,
},
buildModules: ['@nuxtjs/vuetify', ['@nuxtjs/i18n', {
seo: false,
locales: ['fr', 'en'],
defaultLocale: config.i18n.defaultLocale,
vueI18nLoader: true,
strategy: 'no_prefix',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_lang',
},
vueI18n: {
fallbackLocale: config.i18n.defaultLocale,
},
}]], // , '@nuxtjs/svg'
vuetify: {
theme: {
dark: config.theme.dark,
themes: {
light: config.theme.colors,
dark: { ...config.theme.colors, ...config.theme.darkColors },
},
},
defaultAssets: {
font: {
family: 'Nunito',
},
},
lang: {
locales: { fr, en },
current: config.i18n.defaultLocale,
},
},
env: {
publicUrl: config.publicUrl,
// basePath: config.basePath,
directoryUrl: config.directoryUrl,
// adminRole: config.adminRole,
// contribRole: config.contribRole,
// map: config.map,
brand: config.brand,
openapiViewerUrl: config.openapiViewerUrl,
// browserLogLevel: config.browserLogLevel,
// analytics: config.analytics,
// captureUrl: config.captureUrl,
// notifyUrl: config.notifyUrl,
// notifyWSUrl: config.notifyWSUrl,
// subscriptionUrl: config.subscriptionUrl,
// theme: config.theme,
// baseAppsCategories: config.baseAppsCategories,
// datasetUrlTemplate: config.datasetUrlTemplate,
// applicationUrlTemplate: config.applicationUrlTemplate,
// doc: config.doc,
// extraNavigationItems: config.extraNavigationItems,
// extraAdminNavigationItems: config.extraAdminNavigationItems,
// darkModeSwitch: config.darkModeSwitch,
// disableSharing: config.disableSharing,
// disableApplications: config.disableApplications,
// disableRemoteServices: config.disableRemoteServices,
},
head: {
title: config.brand.title,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'application', name: 'application-name', content: config.brand.title },
{ hid: 'description', name: 'description', content: config.brand.description },
{ hid: 'robots', name: 'robots', content: 'noindex' },
],
link: [],
style: [],
},
}
if (config.theme.cssUrl) {
module.exports.head.link.push({ rel: 'stylesheet', href: config.theme.cssUrl })
}
if (config.theme.cssText) {
module.exports.head.style.push({ type: 'text/css', cssText: config.theme.cssText })
}