UNPKG

1.25 kBJavaScriptView Raw
1const path = require('path')
2const fs = require('fs')
3
4const appDirectory = fs.realpathSync(process.cwd())
5const resolveApp = relativePath => path.resolve(appDirectory, relativePath)
6
7const resolveOwn = relativePath => path.resolve(__dirname, '..', relativePath)
8
9module.exports = {
10 appPackageJson: resolveApp('package.json'),
11 appIndexJs: resolveApp('src/index.ts'),
12 appTsConfig: resolveApp('tsconfig.json'),
13 appTsLint: resolveApp('tslint.json'),
14 appDevBundlePath: resolveApp('build'),
15 appSrc: resolveApp('src'),
16 appBuild: resolveApp('dist'),
17 testsSetup: resolveApp('setupTests.ts'),
18 prodBundle: 'bundle.prod.js',
19}
20
21const useTemplate = appDirectory === fs.realpathSync(path.join(__dirname, '..'))
22
23if (useTemplate) {
24 module.exports = {
25 appPackageJson: resolveOwn('package.json'),
26 appIndexJs: resolveOwn('template/src/index.ts'),
27 appTsConfig: resolveOwn('template/tsconfig.json'),
28 appTsLint: resolveOwn('template/tslint.json'),
29 appDevBundlePath: resolveOwn('template/build'),
30 appSrc: resolveOwn('template/src'),
31 appBuild: resolveOwn('template/dist'),
32 testsSetup: resolveOwn('template/setupTests.ts'),
33 prodBundle: 'bundle.prod.js',
34 }
35}