chore: cleanup

This commit is contained in:
Nathan Walker
2020-07-27 12:10:09 -07:00
parent ee8457443e
commit 6bbd6804da
45 changed files with 145 additions and 397 deletions

View File

@@ -58,19 +58,18 @@ function copyTemplate(templateName, destinationPath) {
function getProjectTemplates(projectDir) {
const WEBPACK_CONFIG_NAME = "webpack.config.js";
const TSCONFIG_TNS_NAME = "tsconfig.tns.json";
let templates;
if (isAngular({ projectDir })) {
if (isShared({ projectDir })) {
templates = getSharedAngularTemplates(WEBPACK_CONFIG_NAME);
} else {
templates = getAngularTemplates(WEBPACK_CONFIG_NAME, TSCONFIG_TNS_NAME);
templates = getAngularTemplates(WEBPACK_CONFIG_NAME);
}
} else if (isVue({ projectDir })) {
templates = getVueTemplates(WEBPACK_CONFIG_NAME);
} else if (isTypeScript({ projectDir })) {
templates = getTypeScriptTemplates(WEBPACK_CONFIG_NAME, TSCONFIG_TNS_NAME);
templates = getTypeScriptTemplates(WEBPACK_CONFIG_NAME);
} else {
templates = getJavaScriptTemplates(WEBPACK_CONFIG_NAME);
}
@@ -84,17 +83,15 @@ function getSharedAngularTemplates(webpackConfigName) {
};
}
function getAngularTemplates(webpackConfigName, tsconfigName) {
function getAngularTemplates(webpackConfigName) {
return {
"webpack.angular.js": webpackConfigName,
[tsconfigName]: tsconfigName,
"webpack.angular.js": webpackConfigName
};
}
function getTypeScriptTemplates(webpackConfigName, tsconfigName) {
function getTypeScriptTemplates(webpackConfigName) {
return {
"webpack.typescript.js": webpackConfigName,
[tsconfigName]: tsconfigName,
"webpack.typescript.js": webpackConfigName
};
}