-
Notifications
You must be signed in to change notification settings - Fork 8
/
nuxt.config.js
124 lines (117 loc) · 2.82 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
require("dotenv").config()
module.exports = {
/*
** Build configuration
*/
build: {
extend(config, ctx) {
if (ctx.isDev && ctx.client) {
config.module.rules.push({
enforce: "pre",
test: /\.(js|vue)$/,
loader: "eslint-loader",
exclude: /(node_modules)/
})
const vueLoader = config.module.rules.find(
({ loader }) => loader === "vue-loader"
)
const { options: { loaders } } = vueLoader || { options: {} }
if (loaders) {
for (const loader of Object.values(loaders)) {
changeLoaderOptions(Array.isArray(loader) ? loader : [loader])
}
}
config.module.rules.forEach(rule => changeLoaderOptions(rule.use))
// console.log(util.inspect(config.module.rules, { depth: 6 }))
}
}
},
/*
** Headers
** Common headers are already provided by @nuxtjs/pwa preset
*/
head: {
title: "Loket Pulsa",
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: "description", name: "description", content: "Nuxt.js project" },
// example vue-meta
{
hid: "title",
name: "title",
content: "Agen pulsa all operator indonesia"
}
],
link: [
{ rel: "icon", type: "image/x-icon", href: "~static/lo-xs.png" },
{
rel: "stylesheet",
type: "text/css",
href:
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
},
{
rel: "stylesheet",
type: "text/css",
href:
"https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.7/css/swiper.css"
},
{
rel: "stylesheet",
type: "text/css",
href:
"http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"
}
]
},
css: [
{ src: "~/assets/scss/navigation.scss", lang: "scss" },
{ src: "~/assets/scss/app.scss", lang: "scss" }
],
/*
** Custom Plugin
*/
plugins: [{ src: "~plugins/swiper.js", ssr: false }, "~/plugins/axios"],
/*
** Customize the progress-bar color
*/
loading: { color: "#3B8070" },
/*
** Customize app manifest
*/
manifest: {
theme_color: "#3B8070"
},
/*
** Modules
*/
modules: [
"@nuxtjs/pwa",
"@nuxtjs/axios",
"@nuxtjs/toast",
"@nuxtjs/font-awesome"
],
toast: {
position: "top-center"
},
env: {
baseUrl: process.env.URL_API,
app_name: "Loket Pulsa"
},
router: {
//middleware: "api"
}
}
function changeLoaderOptions(loaders) {
if (loaders) {
for (const loader of loaders) {
if (loader.loader === "sass-loader") {
Object.assign(loader.options, {
includePaths: ["./assets"]
// data: '@import "_imports";'
})
}
}
}
}