Skip to content

Commit b5f5610

Browse files
committed
fix vite warning "missing source files"
fix: #77
1 parent 3fe3a45 commit b5f5610

File tree

1 file changed

+4
-1
lines changed
  • packages/react-pages/src/node/virtual-module-plugins/demo-modules

1 file changed

+4
-1
lines changed

packages/react-pages/src/node/virtual-module-plugins/demo-modules/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { strip } from 'jest-docblock'
22
import { ProxyModulesManager } from '../../utils/virtual-module'
33
import { extractStaticData } from '../../utils/virtual-module/utils'
44

5-
const DEMO_PROXY_PREFIX = '/@react-pages/demos'
5+
// mark demo proxy files as virtual files to avoid vite warning "missing source files"
6+
// https://github.com/vitejs/vite/blob/60721ac53a1bf326d1cac097f23642faede234ff/packages/vite/src/node/server/sourcemap.ts#L39
7+
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
8+
const DEMO_PROXY_PREFIX = '\0/@react-pages/demos'
69

710
export class DemoModuleManager {
811
private pmm = new ProxyModulesManager(DEMO_PROXY_PREFIX)

0 commit comments

Comments
 (0)