· 4 years ago · Jul 21, 2021, 03:26 PM
1import path from 'path'
2import fs from 'fs'
3import axios from 'axios'
4import i18n from './config/i18n'
5
6// const dynamicRoutes = () => {
7// return axios.get('https://stage.praguedays.com/api/listing/search').then((res) => {
8// return res.data.results.map(item => `/catalog/${item.id}`)
9// })
10// }
11
12export default {
13 // Target: https://go.nuxtjs.dev/config-target
14 target: 'static ',
15
16 // generate: {
17 // routes: dynamicRoutes
18 // },
19
20 watchers: {
21 webpack: {
22 ignored: '/node_modules/'
23 }
24 },
25
26 // Global page headers: https://go.nuxtjs.dev/config-head
27 head: {
28 title: 'prague-days-web',
29 htmlAttrs: {
30 lang: 'cs'
31 },
32 meta: [
33 { charset: 'utf-8' },
34 { name: 'viewport', content: 'width=device-width, initial-scale=1' },
35 { hid: 'description', name: 'description', content: '' }
36 ],
37 link: [
38 { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
39 ]
40 },
41
42 // Global CSS: https://go.nuxtjs.dev/config-css
43 css: [
44 'normalize.css/normalize.css',
45 '~/assets/iconfont/dist/nuxt-fontagon-icon.sass'
46 ],
47
48 // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
49 plugins: [
50 '~/plugins/format-price.js',
51 '~/plugins/router.js',
52 '~/plugins/recount-currency.js',
53 '~/plugins/cookies.js',
54 '~/plugins/make-id.js',
55 { src: '~/plugins/vuelidate' },
56 { src: '~/plugins/vuex-persist', ssr: false },
57 { src: '~/plugins/vue-datepicker', ssr: false }
58 ],
59
60 // Auto import components: https://go.nuxtjs.dev/config-components
61 components: true,
62
63 // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
64 buildModules: [
65 // https://go.nuxtjs.dev/eslint
66 '@nuxtjs/eslint-module',
67 '@nuxtjs/style-resources',
68 'nuxt-lazysizes',
69 'nuxt-fontagon',
70 ['nuxt-i18n', {
71 vueI18nLoader: true,
72 defaultLocale: 'cs',
73 skipSettingLocaleOnNavigate: true,
74 locales: [
75 {
76 code: 'cs',
77 name: 'CZ',
78 label: 'Čeština'
79 },
80 {
81 code: 'en',
82 name: 'EN',
83 label: 'English'
84 }
85 ],
86 vueI18n: i18n
87 }]
88 ],
89
90 // Modules: https://go.nuxtjs.dev/config-modules
91 modules: [
92 // https://go.nuxtjs.dev/axios
93 '@nuxtjs/axios',
94 'nuxt-element-ui',
95 'nuxt-leaflet',
96 [
97 'nuxt-mq',
98 {
99 // Default breakpoint for SSR
100 defaultBreakpoint: 'sm',
101 breakpoints: { // TODO proverit zda nejsou breakpointy o jednu uroven posunutou pripadne upravit v Map.vue
102 sm: 576,
103 md: 768,
104 lg: 992,
105 xl: 1200,
106 xxl: Infinity
107 }
108 }
109 ]
110 ],
111
112 iconFont: {
113 fontName: 'nuxt-fontagon-icon',
114 files: ['assets/iconfont/src/*.svg'],
115 dist: 'assets/iconfont/dist/',
116 classOptions: {
117 baseClass: 'svg-font',
118 classPrefix: 'svg-font-'
119 },
120 styleTemplate: {
121 css: 'assets/iconfont/css-template.hbs'
122 // 'sass': 'sass.hbs',
123 // 'less': 'less.hbs',
124 // 'stylus': 'styl.hbs'
125 }
126 },
127
128 // Axios module configuration: https://go.nuxtjs.dev/config-axios
129 axios: {
130 baseURL: 'https://stage.praguedays.com/api',
131 proxyHeaders: false,
132 credentials: false
133 },
134
135 proxy: {
136 // '/api': { target: 'https://stage.praguedays.com/api', pathRewrite: {'^/api': ''} }
137 },
138
139 //
140 // server: {
141 // https: {
142 // key: fs.readFileSync(path.resolve(__dirname, 'server.key')),
143 // cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'))
144 // }
145 // },
146
147 elementUI: {
148 components: [
149 'Slider',
150 'Dialog',
151 'Carousel',
152 'CarouselItem',
153 'Select',
154 'Option',
155 'Tag'
156 ],
157 locale: 'en'
158 },
159
160 lazySizes: {
161 plugins: {
162 blurUp: true,
163 nativeLoading: true,
164 unveilhooks: true
165 },
166 nativeLoading: {
167 setLoadingAttribute: false,
168 listenerMap: {
169 focus: 1,
170 mouseover: 1,
171 click: 1,
172 load: 1,
173 transitionend: 1,
174 animationend: 1,
175 scroll: 1,
176 resize: 1
177 },
178 disableListeners: undefined
179 }
180 },
181
182 styleResources: {
183 scss: [
184 '~/assets/scss/main.scss'
185 ]
186 },
187
188 // Build Configuration: https://go.nuxtjs.dev/config-build
189 build: {
190 extend (config, { isDev, isClient }) {
191 config.node = {
192 fs: 'empty'
193 }
194 }
195 }
196}
197