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

58 lines
1.4 KiB
JavaScript
Raw Normal View History

import path from 'path'
// Remark plugins
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'],
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',
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/')
config.resolve.alias.site = path.resolve(`./`)
return config
},
}
2023-09-29 08:05:40 +02:00
export default config