1
0
Fork 0
freesewing/sites/sde/next.config.mjs

62 lines
1.6 KiB
JavaScript
Raw Normal View History

import path from 'path'
2023-09-29 16:01:27 +02:00
import i18nConfig from './next-i18next.config.js'
// Remark plugins
2023-09-29 17:35:08 +02:00
import remarkFrontmatter from 'remark-frontmatter'
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
import remarkGfm from 'remark-gfm'
import smartypants from 'remark-smartypants'
2023-09-29 08:05:40 +02:00
/*
* This is the NextJS configuration
*/
const config = {
experimental: {
externalDir: true,
},
pageExtensions: ['mjs'],
2023-09-29 16:01:27 +02:00
i18n: i18nConfig.i18n,
webpack: (config, options) => {
// Fixes npm packages that depend on node modules
if (!options.isServer) {
config.resolve.fallback.fs = false
config.resolve.fallback.path = false
config.resolve.fallback.child_process = false
}
2023-09-29 08:05:40 +02:00
// MDX support
config.module.rules.push({
test: /\.mdx?$/,
use: [
options.defaultLoaders.babel,
{
loader: '@mdx-js/loader',
options: {
providerImportSource: '@mdx-js/react',
format: 'mdx',
2023-09-29 17:35:08 +02:00
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm, smartypants],
},
},
],
})
// Fix for nextjs bug #17806
config.module.rules.push({
test: /index.mjs$/,
type: 'javascript/auto',
resolve: {
fullySpecified: false,
},
})
// Aliases
config.resolve.alias.shared = path.resolve('./shared/')
2023-09-29 16:01:27 +02:00
config.resolve.alias.config = path.resolve('./shared/config/')
2023-09-29 17:35:08 +02:00
config.resolve.alias.pkgs = path.resolve('./pkgs/')
config.resolve.alias.site = path.resolve(`./`)
return config
},
}
2023-09-29 08:05:40 +02:00
export default config