1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.hooks = void 0;
|
4 | const path_1 = require("path");
|
5 | const ts_node_1 = require("ts-node");
|
6 | const hooks = {
|
7 | 'run:before'({ argv, rootDir }) {
|
8 | const customPath = argv.find((_arg, index) => index > 0 && argv[index - 1] === '--tsconfig');
|
9 | const tsConfigPath = path_1.resolve(customPath || rootDir, customPath && customPath.endsWith('.json') ? '' : 'tsconfig.json');
|
10 | ts_node_1.register({
|
11 | project: tsConfigPath,
|
12 | compilerOptions: {
|
13 | module: 'commonjs'
|
14 | },
|
15 | transpileOnly: true
|
16 | });
|
17 | },
|
18 | config(config) {
|
19 | config.extensions = [...(config.extensions || []), 'ts'];
|
20 | }
|
21 | };
|
22 | exports.hooks = hooks;
|