forked from realadvisor/rgm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
34 lines (29 loc) · 920 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
33
34
// @flow
const path = require('path');
if (process.env.GOOGLE_API_KEY == null) {
throw new Error(`
You must have GOOGLE_API_KEY environment variable defined
Get your api key at https://developers.google.com/maps/documentation/javascript/get-api-key
Then
GOOGLE_API_KEY={YOUR_API_KEY_HERE} yarn dev
`);
}
/*::
type Config = {| resolve: {| alias: { [string]: string } |} |}
*/
module.exports = ({
assetPrefix: process.env.DOCUMENTATION === 'true' ? '/rgm' : '',
experimental: {
basePath: process.env.DOCUMENTATION === 'true' ? '/rgm' : '',
},
// static, won't work at runtime, use publicRuntimeConfig for runtime
env: {
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY,
DOCUMENTATION: process.env.DOCUMENTATION,
},
webpack: (config /*: Config */) /*: Config */ => {
config.resolve.alias['rgm'] = path.resolve('./src/rgm.js');
return config;
},
// $FlowExpectedError
} /*: any */);