Skip to content

Commit b05e307

Browse files
authored
docs: improve virtual module examples (#7636)
1 parent 8ad0fcf commit b05e307

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guide/api-plugin.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Virtual modules are a useful scheme that allows you to pass build time informati
113113

114114
```js
115115
export default function myPlugin() {
116-
const virtualModuleId = '@my-virtual-module'
116+
const virtualModuleId = 'virtual:my-module'
117117
const resolvedVirtualModuleId = '\0' + virtualModuleId
118118

119119
return {
@@ -135,7 +135,7 @@ export default function myPlugin() {
135135
Which allows importing the module in JavaScript:
136136

137137
```js
138-
import { msg } from '@my-virtual-module'
138+
import { msg } from 'virtual:my-module'
139139

140140
console.log(msg)
141141
```

0 commit comments

Comments
 (0)