File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import { vitePluginFindSourceMapURL } from './plugins/find-source-map-url'
3030import {
3131 ENV_IMPORTS_MANIFEST_NAME ,
3232 vitePluginImportEnvironment ,
33+ type EnvironmentImportMeta ,
3334} from './plugins/import-environment'
3435import {
3536 vitePluginResolvedIdProxy ,
@@ -124,16 +125,7 @@ class RscPluginManager {
124125 { }
125126 serverReferenceMetaMap : Record < string , ServerRerferenceMeta > = { }
126127 serverResourcesMetaMap : Record < string , { key : string } > = { }
127- environmentImportMetaMap : Record <
128- string ,
129- {
130- resolvedId : string
131- targetEnv : string
132- sourceEnv : string
133- specifier : string
134- entryName : string
135- }
136- > = { }
128+ environmentImportMetaMap : Record < string , EnvironmentImportMeta > = { }
137129 // Maps resolvedId to output fileName (populated in generateBundle)
138130 environmentImportOutputMap : Record < string , string > = { }
139131
Original file line number Diff line number Diff line change @@ -51,16 +51,18 @@ export function vitePluginImportEnvironment(
5151 this . environment . mode === 'build' &&
5252 source . endsWith ( ENV_IMPORTS_MANIFEST_NAME )
5353 ) {
54+ // TODO: relativity should be enforced via another renderChunk patch
5455 return { id : './' + ENV_IMPORTS_MANIFEST_NAME , external : true }
5556 }
56- // Virtual scan placeholder for scan builds without entries
5757 if ( source === ENV_IMPORTS_ENTRY_FALLBACK ) {
5858 return '\0' + ENV_IMPORTS_ENTRY_FALLBACK
5959 }
6060 } ,
6161 load ( id ) {
62+ // TODO: how to avoid warning?
63+ // > Generated an empty chunk: "__vite_rsc_env_imports_entry_fallback".
6264 if ( id === '\0' + ENV_IMPORTS_ENTRY_FALLBACK ) {
63- return 'export default () => "__vite_rsc_env_imports_entry_fallback"'
65+ return 'export default "__vite_rsc_env_imports_entry_fallback"'
6466 }
6567 } ,
6668 buildStart ( ) {
You can’t perform that action at this time.
0 commit comments