diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md index 058130cec38414..cf616921671e6d 100644 --- a/docs/guide/api-plugin.md +++ b/docs/guide/api-plugin.md @@ -88,7 +88,7 @@ It is common convention to author a Vite/Rollup plugin as a factory function tha ```js export default function myPlugin() { - const virtualModuleId = '@my-virtual-module' + const virtualModuleId = 'virtual:my-module' const resolvedVirtualModuleId = '\0' + virtualModuleId return { @@ -110,7 +110,7 @@ export default function myPlugin() { Which allows importing the module in JavaScript: ```js -import { msg } from '@my-virtual-module' +import { msg } from 'virtual:my-module' console.log(msg) ```