-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
97 lines (84 loc) · 2.85 KB
/
next.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
// ============================================== //
// ==================== libs ==================== //
// ============================================== //
// const { path } = require('./src/libs/helpers/system')
const { is } = require('./src/libs/functions/check')
//
//
// ============================================= //
// ==================== env ==================== //
// ============================================= //
const envInit = require('dotenv').config
envInit()
// prettier-ignore
const env = {
PWA_ENABLE: is.True.vs(proccess.env.PWA_ENABLE),
PWA_CAN_REGISTER: is.True.vs(proccess.env.PWA_CAN_REGISTER),
PWA_CAN_CACHE: is.True.vs(proccess.env.PWA_CAN_CACHE),
}
//
//
// ==================================================== //
// ==================== extensions ==================== //
// ==================================================== //
// const withCss = require('@zeit/next-css')
// const withSass = require('@zeit/next-sass')
// const withFonts = require('next-fonts')
// const withVideos = require('next-videos')
// const withImages = require('next-images')
// const withReactSvg = require('next-react-svg')
const withTranslate = require('next-translate')
const runtimeCaching = require('next-pwa/cache')
const createWithPWA = require('next-pwa')
// prettier-ignore
const withPWA = createWithPWA({
dest: 'public',
disable: !env.PWA_CAN_CACHE,
register: env.PWA_CAN_REGISTER,
runtimeCaching: env.PWA_CAN_CACHE ? runtimeCaching : undefined,
// buildExcludes: [new RegExp('/stream')],
})
//
//
// ================================================ //
// ==================== config ==================== //
// ================================================ //
/** @type {import('next').NextConfig} */
// prettier-ignore
const nextConfig = withPWA(withTranslate({
// ============ feats ============ //
experimental: {
appDir: true,
},
// ============ react ============ //
reactStrictMode: true,
// ============ style ============ //
// cssModules: true,
compiler: {
styledComponents: true,
},
// ============ langs ============ //
// i18n: {
// locales: ['en', 'pt'],
// defaultLocale: 'en',
// },
// ============ images ============ //
// images: {
// domains: ['provider.com', 'www.provider.com'],
// },
// ============ configs ============ //
// webpack: (config, options) => {
// config.resolve.alias['~/src'] = path.v1.join(__dirname, './src')
// return config
// },
// ============ navigation ============ //
// documentation: 'https://nextjs.org/docs/api-reference/next.config.js/exportPathMap,
// exportTrailingSlash: true,
// exportPathMap: async () => routes,
}))
//
//
// ================================================ //
// ==================== export ==================== //
// ================================================ //
module.exports = nextConfig