Skip to content

Commit

Permalink
modify webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh committed Nov 15, 2023
1 parent bcca4d1 commit 3390a52
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { getInstalledFrontmatterCollection } from 'crypto-frontmatter';

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
BASE_URL: process.env.NEXT_PUBLIC_URL ?? `https://${process.env.VERCEL_URL}` ?? 'https://frontmatter.levain.tech',
},
experimental: {
serverComponentsExternalPackages: getInstalledFrontmatterCollection().map((collection) => collection.name),
webpack: (config, { isServer }) => {
if (isServer) {
config.module.rules.push({
test: /\.json$/,
include: /node_modules\/@crypto-frontmatter\/.+/,
use: 'babel-loader',
});
}

return config;
},
trailingSlash: false,
reactStrictMode: true,
Expand Down

0 comments on commit 3390a52

Please sign in to comment.