Skip to content

Commit

Permalink
fix for reloading for non i18n packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Oct 3, 2024
1 parent 1c8ccb9 commit 593aa8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/nextra/src/client/components/auto-refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useEffect } from 'react'

export const AutoRefresh: FC<{ children: ReactNode }> = ({ children }) => {
const port = process.env.NEXTRA_WS_PORT
console.log({ port })
if (process.env.NODE_ENV === 'production' || !port) {
return children
}
Expand Down
15 changes: 7 additions & 8 deletions packages/nextra/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ const nextra: Nextra = nextraConfig => {
...(nextConfig.pageExtensions || DEFAULT_EXTENSIONS),
...MARKDOWN_EXTENSIONS
],
...(hasI18n && {
i18n: undefined,
env: {
...nextConfig.env,
NEXTRA_DEFAULT_LOCALE: nextConfig.i18n?.defaultLocale || 'en',
...(wsPort && { NEXTRA_WS_PORT: String(wsPort) })
}
}),
env: {
...nextConfig.env,
...(hasI18n && {
NEXTRA_DEFAULT_LOCALE: nextConfig.i18n?.defaultLocale || 'en'
}),
...(wsPort && { NEXTRA_WS_PORT: String(wsPort) })
},
webpack(config, options) {
if (options.nextRuntime !== 'edge' && options.isServer) {
config.plugins ||= []
Expand Down

0 comments on commit 593aa8b

Please sign in to comment.