@moxy/next-common-files
Version:
Next.js plugins that configure webpack with loaders for common files.
19 lines (15 loc) • 444 B
JavaScript
;
module.exports = (userOptions = {}) => (nextConfig = {}) => ({
...nextConfig,
webpack(config, options) {
config.module.rules.push({
test: /\.json5$/,
loader: require.resolve('json5-loader'),
...userOptions,
});
if (typeof nextConfig.webpack === 'function') {
return nextConfig.webpack(config, options);
}
return config;
},
});