Skip to content

Commit 2ad63da

Browse files
allexezolenko
authored andcommitted
Optional dependency of typescript. (#122)
1 parent c291634 commit 2ad63da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export default function typescript(options?: Partial<IOptions>)
5353
exclude: ["*.d.ts", "**/*.d.ts"],
5454
abortOnError: true,
5555
rollupCommonJSResolveHack: false,
56-
typescript: require("typescript"),
5756
tsconfig: undefined,
5857
useTsconfigDeclarationDir: false,
5958
tsconfigOverride: {},
@@ -62,6 +61,10 @@ export default function typescript(options?: Partial<IOptions>)
6261
objectHashIgnoreUnknownHack: false,
6362
});
6463

64+
if (!pluginOptions.typescript) {
65+
pluginOptions.typescript = require("typescript");
66+
}
67+
6568
setTypescriptModule(pluginOptions.typescript);
6669

6770
return {

0 commit comments

Comments
 (0)