Index
Bundle index mapping file paths to their metadata.
Bundle index mapping file paths to their metadata.
The index is stored as binary data in the bundle file and maps file paths to their metadata (offset, length, content-type, headers, etc.).
Constructor
new Index();Methods
Prop
Type
Examples
containsPath
if (index.containsPath('/app.js')) {
console.log('app.js is in the bundle');
}entries
const index = bundle.descriptor().index();
const entries = index.entries();
for (const [path, entry] of Object.entries(entries)) {
console.log(`${path}: ${entry.contentType}`);
}getEntry
const entry = index.getEntry('/index.html');
if (entry) {
console.log(`Content-Type: ${entry.contentType}`);
}