Skip to content

Commit c366f9d

Browse files
committed
Add webpack configuration and output options to
next.config
1 parent 0671cfd commit c366f9d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

next.config.mjs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {
3+
4+
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
5+
config.module.rules.push(
6+
{
7+
test: /\.md$/,
8+
// This is the asset module.
9+
type: 'asset/source',
10+
}
11+
)
12+
return config
13+
},
14+
15+
output:process.env.HOST !=="GitHub" ? "standalone" : "export",
16+
basePath:process.env.HOST !== "GitHub" ? "" : "/tour"
17+
18+
19+
};
320

421
export default nextConfig;

0 commit comments

Comments
 (0)