forked from JetBrains/kotlin-web-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
45 lines (34 loc) · 1.01 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
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'
];
const withTranspile = nextTranspileModules(transpiledPackages);
const nextConfig = {
pageExtensions: ['ts', 'tsx', 'js', 'jsx'],
images: {
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'
});
return config
},
};
module.exports = withPlugins([
[withTranspile],
[optimizedImages]
], nextConfig);