19 lines
671 B
TypeScript
19 lines
671 B
TypeScript
|
import child_process from "child_process";
|
||
|
|
||
|
import {logger} from "../Logger.js";
|
||
|
import CopyAssetPreCompiler from "./CopyAssetPreCompiler.js";
|
||
|
|
||
|
export default class TypeScriptPreCompiler extends CopyAssetPreCompiler {
|
||
|
public constructor(
|
||
|
targetDir: string,
|
||
|
additionalFallbackAssetPaths: string[] = [],
|
||
|
) {
|
||
|
super(targetDir, 'ts', 'ts', additionalFallbackAssetPaths, false, 'ts-source');
|
||
|
|
||
|
this.onPreCompile(async _watch => {
|
||
|
logger.info('Building ts assets...');
|
||
|
await child_process.execSync(`yarn tsc -b tsconfig.frontend.json`, {stdio: [process.stdin, process.stdout, process.stderr]});
|
||
|
});
|
||
|
}
|
||
|
}
|