2021-12-08 03:38:31 +00:00
|
|
|
module.exports = {
|
2021-12-08 07:20:30 +00:00
|
|
|
i18n: {
|
|
|
|
locales: ['en-US'],
|
|
|
|
defaultLocale: 'en-US'
|
|
|
|
},
|
2021-12-08 03:38:31 +00:00
|
|
|
webpack: (config, options) => {
|
|
|
|
config.experiments = { asset: true };
|
|
|
|
|
2022-04-24 04:27:51 +00:00
|
|
|
const { cachePostLinkData } = require('./util/post-cache');
|
|
|
|
|
|
|
|
config.plugins.push(
|
|
|
|
{
|
|
|
|
apply: (compiler) => {
|
2022-04-24 04:40:26 +00:00
|
|
|
compiler.hooks.beforeCompile.tap('cachePostLinkDataInit', _ => {
|
2022-04-24 04:27:51 +00:00
|
|
|
cachePostLinkData();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
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-24 04:27:51 +00:00
|
|
|
|
2022-04-23 23:03:43 +00:00
|
|
|
},
|
2021-12-08 03:38:31 +00:00
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
2022-04-23 23:03:43 +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
|
|
|
},
|
|
|
|
{
|
|
|
|
resourceQuery: /raw/,
|
|
|
|
type: 'asset/source',
|
2022-04-23 23:03:43 +00:00
|
|
|
},
|
2021-12-08 03:38:31 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
return config
|
|
|
|
},
|
|
|
|
}
|