-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
32 lines (29 loc) · 991 Bytes
/
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
const webpack = require('webpack')
const withCSS = require('@zeit/next-css')
/**
* After the next require you can use process.env to get your secrets
*/
require('now-env')
/**
* If some of the envs are public, like a google maps key, but you still
* want to keep them secret from the repo, the following code will allow you
* to share some variables with the client, configured at compile time.
*/
const config = config => {
config.plugins.push(
new webpack.DefinePlugin({
// Shared with front-end
'process.env.APP_NAME': JSON.stringify(process.env.APP_NAME),
'process.env.APP_DESCRIPTION': JSON.stringify(process.env.APP_DESCRIPTION),
'process.env.GOOGLE_KEY': JSON.stringify(process.env.GOOGLE_KEY),
'process.env.FACEBOOK_APP_ID': JSON.stringify(process.env.FACEBOOK_APP_ID)
})
// Same as above
// new webpack.EnvironmentPlugin(['SECRET'])
)
return config
}
module.exports = withCSS({
cssModules: true,
webpack: config
})