Skip to content

Commit 9f534a9

Browse files
author
Tajudeen
committed
Fix rimraf import: use require() for CommonJS rimraf 2.2.8
- Change from 'import * as rimrafModule' to 'const rimrafModule = require()' - Fixes TS2349 error: Type 'typeof rimraf' has no call signatures - rimraf 2.x is a pure CommonJS module without ES module wrapper
1 parent 216cae5 commit 9f534a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build/lib/util.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import _filter from 'gulp-filter';
99
import rename from 'gulp-rename';
1010
import path from 'path';
1111
import fs from 'fs';
12-
import * as rimrafModule from 'rimraf';
12+
1313
import VinylFile from 'vinyl';
1414
import { ThroughStream } from 'through';
1515
import sm from 'source-map';
@@ -18,6 +18,9 @@ import ternaryStream from 'ternary-stream';
1818

1919
const root = path.dirname(path.dirname(__dirname));
2020

21+
// Use require for rimraf 2.2.8 (CommonJS module, no default export)
22+
const rimrafModule = require('rimraf');
23+
2124
export interface ICancellationToken {
2225
isCancellationRequested(): boolean;
2326
}

0 commit comments

Comments
 (0)