-
Notifications
You must be signed in to change notification settings - Fork 20
/
next.config.js
32 lines (30 loc) · 973 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 path = require('path')
const shouldPrefix = process.env.PREFIX === 'true'
/** @type {import('next').NextConfig} */
module.exports = {
assetPrefix: shouldPrefix ? '/react-runner/' : '',
basePath: shouldPrefix ? '/react-runner' : '',
compiler: {
styledComponents: true,
},
// ensure counter won't be incremented twice
reactStrictMode: false,
webpack: (config, options) => {
config.resolve.alias = {
...config.resolve.alias,
'react-runner': path.resolve(__dirname, '../packages/react-runner'),
'react-live-runner': path.resolve(
__dirname,
'../packages/react-live-runner'
),
'react-runner-codemirror': path.resolve(
__dirname,
'../packages/react-runner-codemirror'
),
react: path.resolve(__dirname, './node_modules/react'),
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
}
// Important: return the modified config
return config
},
}