Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import { resolve as resolvePath } from 'path';
import { promisify } from 'util';
import { Plugin, ExistingRawSourceMap } from 'rollup';
import pluginUtils, { CreateFilter } from '@rollup/pluginutils';
Expand Down Expand Up @@ -32,7 +33,9 @@ export default function sourcemaps({
return null;
}

let code: string;
// Allow the original file to be watched
this.addWatchFile(resolvePath(id));

try {
code = (await promisifiedReadFile(id)).toString();
} catch {
Expand Down