-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnuxt.config.js
executable file
·83 lines (76 loc) · 2.08 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
// Info about configuration https://nuxtjs.org/guide/configuration/
const webpack = require('webpack');
const path = require('path');
const { paths, environments } = require('./tasks/config/options');
const _ = require('./tasks/config/helpers');
const avatarsMiddleware = require('adorable-avatars');
let rules = require('require.all')('./tasks/rules');
const environment = process.env.NODE_ENV;
rules((name, rule) => rule(environment, environments));
const vendor = [
'babel-polyfill',
'reflect-metadata',
'inversify',
'vue-perfect-scrollbar'];
const plugins = [
'~/plugins/inversify',
'~/plugins/axios',
'~/plugins/filters',
{ src: '~/plugins/components', ssr: false }
];
const modules = [
'@nuxtjs/axios',
'@nuxtjs/bootstrap-vue',
'~/modules/typescript',
'~/modules/separated-files',
'~/modules/components-name',
'~/modules/languages'
];
module.exports = {
env: environment,
head: {
title: 'My App',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
]
},
loading: { color: '#054A59' },
plugins,
modules,
router: {
base: environment !== 'development' ? '/FooCards-Nuxt/' : '/', // Only for demo
middleware: ['settings'],
linkActiveClass: 'is-active'
},
languages: {
locales: ['es', 'en'],
defaultLocale: 'en'
},
build: {
extractCSS: true,
vendor,
extend(config) {
const customRules = [
rules.scriptsLint
];
config.module.rules = [...config.module.rules, ...customRules];
},
plugins: []
},
axios: {
baseURL: process.env.BASE_URL || '/'
},
srcDir: './app',
buildDir: './.temp/.nuxt',
css: ['./.temp/css/styles/app.css'],
generate: {
dir: 'docs' // because gh pages, this is a demo
},
serverMiddleware: [
'~~/fakeapi/index.js'
]
}