www/next.config.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-12-08 03:38:31 +00:00
module.exports = {
i18n: {
locales: ['en-US'],
defaultLocale: 'en-US'
},
webpack: (config, _options) => {
2022-10-05 03:41:59 +00:00
const { cache } = require('./lib/slug');
config.plugins.push(
{
apply: (compiler) => {
2022-04-28 01:55:18 +00:00
compiler.hooks.beforeCompile.tap('cachePostDataBC', _ => {
cache();
});
}
}
)
2021-12-08 03:38:31 +00:00
config.module.rules.push(
2022-04-23 23:03:43 +00:00
{
test: /\.ya?ml$/,
use: 'js-yaml-loader',
2022-04-23 23:03:43 +00:00
},
2021-12-08 03:38:31 +00:00
{
test: /\.svg$/,
2022-04-27 08:03:21 +00:00
use: [{ loader: '@svgr/webpack' }],
2021-12-08 03:38:31 +00:00
},
{
test: /\.md$/,
2022-04-23 23:03:43 +00:00
type: 'asset/source',
2021-12-08 03:38:31 +00:00
},
{
test: /\.otf$/,
2022-04-23 23:03:43 +00:00
type: 'asset/resource',
2021-12-08 03:38:31 +00:00
},
2022-05-15 13:56:45 +00:00
{
test: /\.txt$/,
type: 'asset/source',
},
2021-12-08 03:38:31 +00:00
{
resourceQuery: /raw/,
type: 'asset/source',
2022-04-23 23:03:43 +00:00
},
2021-12-08 03:38:31 +00:00
);
return config
},
images: {
domains: ['avatars.githubusercontent.com']
},
2021-12-08 03:38:31 +00:00
}