1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.paths = exports.resolveOwn = exports.resolveApp = void 0;
|
4 | const tslib_1 = require("tslib");
|
5 | const fs = (0, tslib_1.__importStar)(require("fs"));
|
6 | const path = (0, tslib_1.__importStar)(require("path"));
|
7 | const appDirectory = fs.realpathSync(process.cwd());
|
8 | const useTemplate = appDirectory === fs.realpathSync(path.join(__dirname, '../..'));
|
9 | function resolveApp(relativePath) {
|
10 | return path.resolve(appDirectory, relativePath);
|
11 | }
|
12 | exports.resolveApp = resolveApp;
|
13 | function resolveOwn(relativePath) {
|
14 | return path.resolve(__dirname, '../..', relativePath);
|
15 | }
|
16 | exports.resolveOwn = resolveOwn;
|
17 | exports.paths = useTemplate
|
18 | ? {
|
19 | appPackageJson: resolveOwn('package.json'),
|
20 | appIndexJs: resolveOwn('template/src/index.ts'),
|
21 | appTsConfig: resolveOwn('template/tsconfig.json'),
|
22 | appEslint: resolveOwn('template/.eslintrc.json'),
|
23 | appDevBundlePath: resolveOwn('template/build'),
|
24 | appSrc: resolveOwn('template/src'),
|
25 | appBuild: resolveOwn('template/dist'),
|
26 | testsSetup: resolveOwn('template/setupTests.ts'),
|
27 | webpackOverride: resolveOwn('template/webpack.config.override.js'),
|
28 | prodBundle: 'bundle.prod.js',
|
29 | legacyAppTslint: resolveOwn('template/tslint.json'),
|
30 | }
|
31 | : {
|
32 | appPackageJson: resolveApp('package.json'),
|
33 | appIndexJs: resolveApp('src/index.ts'),
|
34 | appTsConfig: resolveApp('tsconfig.json'),
|
35 | appEslint: resolveApp('.eslintrc.json'),
|
36 | appDevBundlePath: resolveApp('build'),
|
37 | appSrc: resolveApp('src'),
|
38 | appBuild: resolveApp('dist'),
|
39 | testsSetup: resolveApp('setupTests.ts'),
|
40 | webpackOverride: resolveApp('webpack.config.override.js'),
|
41 | prodBundle: 'bundle.prod.js',
|
42 | legacyAppTslint: resolveApp('tslint.json'),
|
43 | };
|
44 |
|
\ | No newline at end of file |