-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
45 lines (41 loc) · 1.11 KB
/
next.config.js
File metadata and controls
45 lines (41 loc) · 1.11 KB
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
/* eslint-disable @typescript-eslint/no-var-requires */
require('webpack');
const path = require('path');
const assetPrefix = process.env.ASSET_PREFIX || '';
const LitePlusClients = process.env.LITE_PLUS_CLIENTS || '';
const CDN_ENPOINT = process.env.CDN_ENDPOINT || 'https://econext-cdn.azureedge.net';
module.exports =
{
publicRuntimeConfig: {
EcoCDNEndPoint: CDN_ENPOINT,
LitePlusClients
},
cssModules: false,
assetPrefix,
webpack(config, { isServer }) {
if (!isServer) {
config.node = {
fs: 'empty',
};
}
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
},
});
// necesary for Edge to support spread operator (knex was not babeled)
config.module.rules.push({
test: /\.js(\?[^?]*)?$/,
include: [path.resolve(__dirname, './node_modules/knex')],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-proposal-object-rest-spread'],
},
},
});
return config;
},
}