瀏覽代碼

setup config for production

AykutSarac 3 年之前
父節點
當前提交
07ecb14ba5
共有 1 個文件被更改,包括 12 次插入3 次删除
  1. 12 3
      next.config.js

+ 12 - 3
next.config.js

@@ -1,7 +1,16 @@
+const isProd = process.env.NODE_ENV === "production";
+const assetPrefix = isProd ? '/jsonvisio.com' : ''
+
 /** @type {import('next').NextConfig} */
 /** @type {import('next').NextConfig} */
 const nextConfig = {
 const nextConfig = {
+  basePath: '/jsonvisio.com',
+  exportPathMap: () => ({
+    '/': { page: '/' },
+    '/editor': { page: '/editor' },
+  }),
+  assetPrefix,
   reactStrictMode: true,
   reactStrictMode: true,
-  trailingSlash: true
-}
+  trailingSlash: true,
+};
 
 
-module.exports = nextConfig
+module.exports = nextConfig;