forked from JetBrains/kotlin-web-site
-
Notifications
You must be signed in to change notification settings - Fork 18
/
next.config.js
51 lines (38 loc) · 1.23 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const packageJSON = require('./package.json');
const withPlugins = require('next-compose-plugins');
const { patchWebpackConfig } = require('next-global-css');
const nextTranspileModules = require('next-transpile-modules');
const optimizedImages = require('next-optimized-images');
let transpiledPackages = [
'@jetbrains/kotlin-web-site-ui',
...(Object.keys(packageJSON.dependencies).filter(it => it.includes('@rescui/'))),
// transitive deps needed too:
'@rescui/dropdown',
'@rescui/menu'
];
const withTranspile = nextTranspileModules(transpiledPackages);
const nextConfig = {
output: 'export',
pageExtensions: ['ts', 'tsx', 'js', 'jsx'],
images: {
unoptimized: true,
disableStaticImages: true,
},
trailingSlash: true,
eslint: {
dirs: ['blocks', 'components', 'pages'],
},
webpack: (config, options) => {
patchWebpackConfig(config, options);
config.module.rules.push({
test: /\.ya?ml$/,
use: 'yaml-loader',
});
config.module.rules.push({
test: /\.md$/,
type: 'asset/source'
});
return config;
},
};
module.exports = withPlugins([[withTranspile], [optimizedImages]], nextConfig);