mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user