Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
code simplification
  • Loading branch information
gasnier committed Mar 28, 2021
commit bdd8cc927994bfd207c1bc7be0ff28ca46fe7fc7
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as webpack from 'webpack';

import * as constants from './constants';
import {
buildSolutionReferences,
getEmitOutput,
getInputFileNameFromOutput,
getTypeScriptInstance,
Expand Down Expand Up @@ -52,6 +53,7 @@ function successLoader(
instance: TSInstance
) {
initializeInstance(loaderContext, instance);
buildSolutionReferences(instance, loaderContext); //build references after setting transformers and hooks
reportTranspileErrors(instance, loaderContext);
const rawFilePath = path.normalize(loaderContext.resourcePath);

Expand Down
3 changes: 1 addition & 2 deletions src/instances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ export function initializeInstance(
: instance.compiler.createProgram([], instance.compilerOptions));

instance.transformers = getCustomTransformers(program);
buildSolutionReferences(instance, loader); //build references after setting transformers
// Setup watch run for solution building
if (instance.solutionBuilderHost) {
addAssetHooks(loader, instance);
Expand Down Expand Up @@ -455,7 +454,7 @@ export function initializeInstance(
instance.languageService!.getProgram()
);
}
buildSolutionReferences(instance, loader); //build references after setting transformers

addAssetHooks(loader, instance);

loader._compiler.hooks.watchRun.tapAsync(
Expand Down