Skip to content

Commit

Permalink
Optional dependency of typescript.
Browse files Browse the repository at this point in the history
  • Loading branch information
allex committed Dec 1, 2018
1 parent df89e70 commit 936c034
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export default function typescript(options?: Partial<IOptions>)
exclude: ["*.d.ts", "**/*.d.ts"],
abortOnError: true,
rollupCommonJSResolveHack: false,
typescript: require("typescript"),
tsconfig: undefined,
useTsconfigDeclarationDir: false,
tsconfigOverride: {},
Expand All @@ -62,6 +61,10 @@ export default function typescript(options?: Partial<IOptions>)
objectHashIgnoreUnknownHack: false,
});

if (!pluginOptions.typescript) {
pluginOptions.typescript = require('typescript');
}

setTypescriptModule(pluginOptions.typescript);

return {
Expand Down

0 comments on commit 936c034

Please sign in to comment.