diff --git a/src/rollup-vsix-plugin.ts b/src/rollup-vsix-plugin.ts index 262514c7..c8918db7 100644 --- a/src/rollup-vsix-plugin.ts +++ b/src/rollup-vsix-plugin.ts @@ -12,7 +12,7 @@ interface Options { exclude?: FilterPattern rollupPlugins?: InputPluginOption[] transformManifest?: (manifest: IExtensionManifest) => IExtensionManifest - getAdditionalResources?: (manifest: IExtensionManifest) => Promise + getAdditionalResources?: (manifest: IExtensionManifest, getFileContent: (path: string) => Promise, listFiles: (path: string) => Promise) => Promise } function read (stream: Readable): Promise { @@ -86,15 +86,15 @@ export default function plugin ({ const getFileContent = async (filePath: string): Promise => { return readFileSync(filePath) } - const listFiles = async (path: string) => { - return (vsixFS.readdirSync(path) as string[]) + const listFiles = async (filePath: string) => { + return (vsixFS.readdirSync(path.join('/', filePath)) as string[]) } const extensionResources = (await extractResourcesFromExtensionManifest(manifest, getFileContent, listFiles)) .filter(resource => vsixFS.existsSync(path.join('/', resource.realPath ?? resource.path))) const resources = [ ...extensionResources, - ...await getAdditionalResources(manifest) + ...await getAdditionalResources(manifest, getFileContent, listFiles) ] const pathMapping = (await Promise.all(resources.map(async resource => {