-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
49 lines (47 loc) · 1.32 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
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
compiler: {
styledComponents: true,
},
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push(
{
test: /\.(png|jpe?g|gif|svg|webp|jp2)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
fallback: 'file-loader',
publicPath: `/_next/static/assets/images/`,
outputPath: `${isServer ? '../' : ''}static/assets/images/`,
name: '[name]-[hash].[ext]',
},
},
],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
{
loader: 'file-loader',
options: {
publicPath: `/_next/static/assets/fonts/`,
outputPath: `${isServer ? '../' : ''}static/assets/fonts/`,
name: '[name]-[hash].[ext]',
},
},
],
}
);
return config;
},
// assetPrefix: isProd ? 'https://boonsuen.com/process-scheduling-solver' : '',
env: {
ASSET_PREFIX: isProd
? 'https://cpu-2uaeb007k-krishmakhijani.vercel.app'
: '',
BASE: isProd ? '/process-scheduling-solver' : '',
},
basePath: isProd ? '/process-scheduling-solver' : '',
};