Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class LiveSyncTrackActionNames {
}

export const PackageJsonKeysToKeep: Array<String> = ["name", "main", "android", "version", "pluginsData"];
export const TemplatesV2PackageJsonKeysToRemove: Array<String> = ["name", "version", "displayName", "templateType", "author", "keywords", "homepage", "bugs"];

export class SaveOptions {
static PRODUCTION = "save";
Expand Down
4 changes: 2 additions & 2 deletions lib/services/project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import * as shelljs from "shelljs";
import { format } from "util";
import { exported } from "../common/decorators";
import { Hooks } from "../constants";
import { Hooks, TemplatesV2PackageJsonKeysToRemove } from "../constants";

export class ProjectService implements IProjectService {

Expand Down Expand Up @@ -212,7 +212,7 @@ export class ProjectService implements IProjectService {
const packageJsonData = this.$fs.readJson(projectFilePath);

// Remove the metadata keys from the package.json
let updatedPackageJsonData = _.omitBy<any, any>(packageJsonData, (value: any, key: string) => _.startsWith(key, "_"));
let updatedPackageJsonData = _.omitBy<any, any>(packageJsonData, (value: any, key: string) => _.startsWith(key, "_") || TemplatesV2PackageJsonKeysToRemove.indexOf(key) !== -1);
updatedPackageJsonData = _.merge(updatedPackageJsonData, this.packageJsonDefaultData);

if (updatedPackageJsonData.nativescript && updatedPackageJsonData.nativescript.templateVersion) {
Expand Down