www/next.config.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

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