-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
30 lines (28 loc) · 1.14 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
const path = require('path');
const withImages = require('next-images');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: [process.env.ANALYZE === 'true'],
});
/** @type {import('next').NextConfig} */
let nextConfig = {
webpack(config, { dev, isServer }) {
if (dev && !isServer) {
const originalEntry = config.entry;
config.entry = async () => {
const entries = await originalEntry();
// Why did you render.
// const wdrPath = path.resolve(__dirname, "./scripts/wdyr.ts");
// if (entries["main.js"] && !entries["main.js"].includes(wdrPath)) {
// entries["main.js"].push(wdrPath);
// }
return entries;
};
}
return config;
},
reactStrictMode: true,
env: {},
transpilePackages: ['@patternfly/react-core', '@patternfly/react-styles', '@patternfly-labs/react-form-wizard', '@patternfly/react-table', 'redux-persist'],
};
nextConfig = withImages(nextConfig);
module.exports = process.env.ANALYZE === 'true' ? withBundleAnalyzer(nextConfig) : nextConfig;