We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9665a0 commit 49e16b5Copy full SHA for 49e16b5
src/index.ts
@@ -12,8 +12,8 @@ export default (transform?: (metadata: string) => string): Plugin => {
12
name: 'userscript-metadata',
13
async resolveId(source, importer, options) {
14
if (source.endsWith(suffix)) {
15
- const sourceFile = source.slice(0, -suffix.length);
16
- const { id } = await this.resolve(sourceFile, importer, options);
+ let { id } = await this.resolve(source, importer, options);
+ if (id.endsWith(suffix)) id = id.slice(0, -suffix.length);
17
metadataMap.set(importer, id);
18
return source;
19
}
0 commit comments