forked from tinacms/tina.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
53 lines (43 loc) · 1.37 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
const { aliasTinaDev } = require('@tinacms/webpack-helpers')
const MomentLocalesPlugin = require('moment-locales-webpack-plugin')
const withSvgr = require('next-svgr')
require('dotenv').config()
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const dummyMailchimpEndpoint =
'https://theDomainHere.us18.list-manage.com/subscribe/post?u=1512315231252&id=0asd21t12e1'
const config = {
env: {
MAILCHIMP_ADDRESS: process.env.MAILCHIMP_ADDRESS || dummyMailchimpEndpoint,
HUBSPOT_TEAMS_FORM_ID: process.env.HUBSPOT_TEAMS_FORM_ID,
HUBSPOT_PORTAL_ID: process.env.HUBSPOT_PORTAL_ID,
GTM_ID: process.env.GTM_ID,
GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID,
BASE_REPO_FULL_NAME: process.env.BASE_REPO_FULL_NAME,
BASE_BRANCH: process.env.BASE_BRANCH,
},
trailingSlash: true,
exportPathMap: async function() {
return {}
},
webpack(config) {
if (process.env.TINA) {
let watch
if (process.env.TINA_WATCH) {
watch = process.env.TINA_WATCH.split(',')
}
aliasTinaDev(config, process.env.TINA, watch)
}
config.module.rules.push({
test: /\.md$/,
use: 'raw-loader',
})
config.node = {
fs: 'empty',
}
config.plugins.push(new MomentLocalesPlugin())
return config
},
}
module.exports = withBundleAnalyzer(withSvgr(config))