Skip to content

Commit 6d40c52

Browse files
refactor: derive and reuse isWebpack5 in index loader
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/45ce3f0d-3ab9-47ff-8520-23271ab092af Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
1 parent 44d0ab9 commit 6d40c52

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function loader(
4141
) {
4242
this.cacheable && this.cacheable();
4343
const callback = this.async();
44-
const options = getLoaderOptions(this, typeof this.getOptions === 'function');
44+
const isWebpack5 = typeof this.getOptions === 'function';
45+
const options = getLoaderOptions(this, isWebpack5);
4546
const instanceOrError = getTypeScriptInstance(options, this);
4647

4748
if (instanceOrError.error !== undefined) {

0 commit comments

Comments
 (0)