UNPKG

1.9 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.paths = exports.resolveOwn = exports.resolveApp = void 0;
4const tslib_1 = require("tslib");
5const fs = (0, tslib_1.__importStar)(require("fs"));
6const path = (0, tslib_1.__importStar)(require("path"));
7const appDirectory = fs.realpathSync(process.cwd());
8const useTemplate = appDirectory === fs.realpathSync(path.join(__dirname, '../..'));
9function resolveApp(relativePath) {
10 return path.resolve(appDirectory, relativePath);
11}
12exports.resolveApp = resolveApp;
13function resolveOwn(relativePath) {
14 return path.resolve(__dirname, '../..', relativePath);
15}
16exports.resolveOwn = resolveOwn;
17exports.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//# sourceMappingURL=paths.js.map
\No newline at end of file