UNPKG

roadhogx

Version:

Cli tool for serve and build react app, based on roadhog, support JSON pattern config, support more features

29 lines (24 loc) 806 B
const { resolve } = require('path'); const { realpathSync } = require('fs'); function resolveOwn(relativePath) { return resolve(__dirname, relativePath); } export default function getPaths(cwd) { const appDirectory = realpathSync(cwd); function resolveApp(relativePath) { return resolve(appDirectory, relativePath); } return { appBuild: resolveApp('dist'), appPublic: resolveApp('public'), appPackageJson: resolveApp('package.json'), appSrc: resolveApp('src'), appNodeModules: resolveApp('node_modules'), ownNodeModules: resolveOwn('../../node_modules'), dllNodeModule: resolveApp('public/dll'), dllManifest: resolveApp('public/dll/roadhog.json'), appBabelCache: resolveApp('node_modules/.cache/babel-loader'), resolveApp, appDirectory, }; }