Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot authored Nov 25, 2024
2 parents d7c5aa3 + 65f045e commit 78c3503
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ const config = {
],
},
],
function (context, options) {
return {
name: 'development-redirects',
configureWebpack(config, isServer, utils) {
if (process.env.NODE_ENV === 'development') {
return {
devServer: {
onBeforeSetupMiddleware: function (devServer) {
devServer.app.get('*', function (req, res, next) {
// If path doesn't start with /docs, redirect to Next.js
if (!req.path.startsWith('/docs/')) {
return res.redirect(`http://localhost:3000${req.path}`)
}
next()
})
}
}
}
}
}
}
}
].filter(Boolean),

themeConfig: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "Apache-2.0",
"scripts": {
"start": "cross-env docusaurus start",
"start": "cross-env docusaurus start --port 3001",
"prebuild": "docusaurus clear && node ./scripts/cleanup-guidelines",
"build": "cross-env NO_UPDATE_NOTIFIER=true USE_SIMPLE_CSS_MINIFIER=true PWA_SW_CUSTOM= docusaurus build",
"deploy": "docusaurus deploy",
Expand Down

0 comments on commit 78c3503

Please sign in to comment.