Skip to content

Commit

Permalink
wip: support dynamic import chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 9, 2024
1 parent fc158a2 commit 40314fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vite/misc/rolldown-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,13 @@ self.__rolldown_runtime = {
}
}
},
/**
* @param {string} chunkName
*/
async ensureChunk(chunkName) {
// TODO: chunk manifest? (need to inject from generateBundle?)
const chunkPath = chunkName
const data = await import(chunkPath)
Object.assign(this.moduleFactoryMap, data.default)
},
}

0 comments on commit 40314fc

Please sign in to comment.