Skip to content

Commit

Permalink
🏗️ Redirect on studio
Browse files Browse the repository at this point in the history
  • Loading branch information
Riley1101 committed Oct 26, 2022
1 parent f794816 commit 11bae1b
Showing 9 changed files with 2,267 additions and 3 deletions.
13 changes: 11 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
/** @type {import('next').NextConfig} */
const STUDIO_REWRITE = {
source: "/studio/:path*",
destination:
process.env.NODE_ENV === "development"
? "http://localhost:3333/studio/:path*"
: "/studio/index.html",
};

const nextConfig = {
reactStrictMode: true,
swcMinify: true,
}
rewrites: () => [STUDIO_REWRITE],
};

module.exports = nextConfig
module.exports = nextConfig;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "echo 'Building Sanity to public/studio…' && cd studio && sanity build ../public/studio -y && cd .. && next build",
"start": "next start",
"lint": "next lint"
},
@@ -14,6 +14,7 @@
"react-dom": "18.2.0"
},
"devDependencies": {
"concurrently": "^7.5.0",
"eslint": "8.26.0",
"eslint-config-next": "13.0.0"
}
Loading

0 comments on commit 11bae1b

Please sign in to comment.