Resolve paths and add check for yarn/npx
This commit is contained in:
19
config/paths.js
Normal file
19
config/paths.js
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const appDirectory = fs.realpathSync(process.cwd());
|
||||
const resolveApp = (relativePath = "") =>
|
||||
path.resolve(appDirectory, relativePath);
|
||||
const templateDirectory = fs.realpathSync(__dirname);
|
||||
const resolveTemplate = (relativePath = "") =>
|
||||
path.resolve(templateDirectory, "..", relativePath);
|
||||
|
||||
module.exports = {
|
||||
template: resolveTemplate(),
|
||||
templateBuild: resolveTemplate("build"),
|
||||
appRdJson: resolveApp("build/rd.json"),
|
||||
appBuild: resolveApp("build"),
|
||||
appYarnLock: resolveApp("yarn.lock"),
|
||||
};
|
||||
Reference in New Issue
Block a user