forked from devfile/registry-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
34 lines (33 loc) · 1.06 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
/* eslint-disable @typescript-eslint/no-var-requires */
const typescriptIsTransformer = require('typescript-is/lib/transform-inline/transformer').default;
const withPlugins = require('next-compose-plugins');
const withPWA = require('next-pwa');
const withImages = require('next-images');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
});
const withTM = require('next-transpile-modules')([
'@patternfly/react-core',
'@patternfly/react-styles'
]);
module.exports = withPlugins([withTM, withImages, withBundleAnalyzer, withPWA], {
webpack: (config) => {
config.module.rules.push({
test: /\.ts$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
getCustomTransformers: (program) => ({
before: [typescriptIsTransformer(program)]
})
}
});
return config;
},
basePath: process.env.DEVFILE_VIEWER_ROOT ? process.env.DEVFILE_VIEWER_ROOT : '',
pwa: {
disable: process.env.NODE_ENV === 'development',
register: true,
dest: 'public'
}
});