Skip to content

Commit

Permalink
fix: add eject.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Nov 28, 2024
1 parent 2870975 commit ee720cf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/vike-react-chakra/eject.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is work-in-progress, see:
// - https://github.com/brillout/playground_eject-vike-react-chakra
// - https://github.com/snake-py/eject/issues/4#issuecomment-2506217514
export const config = {
files: 'Wrapper.tsx',
operations: ['mv Wrapper.tsx pages/+Wrapper.tsx'],
}
14 changes: 14 additions & 0 deletions packages/vike-react/eject.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This is work-in-progress, see:
// - https://github.com/brillout/playground_eject-vike-react
// - https://github.com/snake-py/eject/issues/4#issuecomment-2506217514
export const config = {
files: 'src/*',
operations: [
'mv integration renderer',
'mv config.ts renderer/+config.ts',
'mv renderer/onRenderHtml.tsx renderer/+onRenderHtml.tsx',
'mv renderer/onRenderClient.tsx renderer/+onRenderClient.tsx',
'mv renderer/Loading.tsx renderer/+Loading.tsx',
'rm index.ts',
],
}
4 changes: 4 additions & 0 deletions packages/vike-react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ssrEffect } from './integration/ssrEffect.js'
import { isNotFalse } from './utils/isNotFalse.js'

const config = {
// @eject-remove start
name: 'vike-react',
require: {
vike: '>=0.4.182',
Expand All @@ -17,6 +18,7 @@ const config = {
// https://vike.dev/onRenderClient
onRenderClient: 'import:vike-react/__internal/integration/onRenderClient:onRenderClient',

// @eject-remove end
passToClient: [
'_configFromHook',
// https://github.com/vikejs/vike-react/issues/25
Expand Down Expand Up @@ -114,7 +116,9 @@ const config = {
},
},
} satisfies Config
// @eject-remove start

// This is required to make TypeScript load the global interfaces Vike.Config and Vike.PageContext so that they're always loaded: we can assume that the user always imports this file over `import vikeReact from 'vike-react/config'`
import './types/Config.js'
import './types/PageContext.js'
// @eject-remove end

0 comments on commit ee720cf

Please sign in to comment.