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 58fb417 commit c65a9beCopy full SHA for c65a9be
plugin/index.ts
@@ -290,7 +290,9 @@ export const visualizer = (
290
});
291
292
if (opts.emitFile) {
293
- if (path.isAbsolute(filename) || filename.startsWith("./") || filename.startsWith("../")) {
+ // Regex checks for filenames starting with `./`, `../`, `.\` or `..\`
294
+ // to account for windows-style path separators
295
+ if (path.isAbsolute(filename) || /^\.{1,2}[/\\]/.test(filename)) {
296
this.error(ERR_FILENAME_EMIT);
297
}
298
this.emitFile({
0 commit comments