Skip to content

Commit 1baeaba

Browse files
committed
add basepath for production to work with routes
1 parent 689edcd commit 1baeaba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

next.config.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
22
enabled: false, //process.env.ANALYZE === 'true',
33
});
44

5+
const isProd = process.env.VERCEL_ENV === "production"; // or NODE_ENV === 'production'
6+
57
module.exports = withBundleAnalyzer({
6-
swcMinify: true, // Enable SWC minification
8+
swcMinify: true,
79
reactStrictMode: true,
8-
output: "standalone", // lightweight standalone app
10+
output: "standalone",
11+
basePath: isProd ? "/try/sandbox" : "",
12+
assetPrefix: isProd ? "/try/sandbox/" : "",
913
});

0 commit comments

Comments
 (0)