-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
38 lines (33 loc) · 922 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
35
36
37
38
// next.config.js
const withCSS = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');
const withImages = require('next-images');
const webpack = require('webpack');
require('dotenv').config();
const { compose } = require('redux');
const enhanceApp = compose(
withSass,
withCSS,
withImages,
);
module.exports = enhanceApp({
webpack(config, options) {
config.module.rules.unshift({
test: /\.component.svg$/,
use: ['@svgr/webpack'],
});
const env = Object.keys(process.env).reduce((acc, curr) => {
acc[`process.env.${curr}`] = JSON.stringify(process.env[curr]);
return acc;
}, {});
config.plugins.push(new webpack.DefinePlugin(env));
// console.log('config', config);
return config;
},
distDir: '../build',
poweredByHeader: false,
exclude: /\.component.svg$/,
});
// module.exports = withCSS({
// /* config options here */
// });