-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.original.1618114020833.js
More file actions
39 lines (32 loc) · 1.07 KB
/
next.config.original.1618114020833.js
File metadata and controls
39 lines (32 loc) · 1.07 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
const webpack = require('webpack');
// next-plugins
const withPlugins = require('next-compose-plugins');
const withSourceMaps = require('@zeit/next-source-maps')();
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const nextConfig = {
// eslint-disable-next-line arrow-parens
webpack: config => {
config.resolve.modules.push(__dirname);
const prod = process.env.NODE_ENV === 'production';
config.module.rules.push({ // 웹팩설정에 로더 추가함
test: /\.svg$/,
issuer: {
test: /\.(js|ts)x?$/,
},
use: ['@svgr/webpack'],
});
config.plugins.push(new webpack.IgnorePlugin(/(?:\/tests|__mocks)/));
// moment locale size is too big
config.plugins.push(
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /(en)/),
);
return {
...config,
mode: prod ? 'production' : 'development',
devtool: prod ? 'inline-source-map' : 'eval',
};
},
};
module.exports = withPlugins([withSourceMaps, withBundleAnalyzer], nextConfig);