Skip to content

Commit

Permalink
fix(cordova): add cordova.js to index.html even without scripts array
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgroenen authored and imhoffd committed Jan 10, 2020
1 parent 4bea3a4 commit c8bb37b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions builders/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export function prepareBrowserConfig(
optionsStarter.deleteOutputPath = false;
}

// Initialize an empty script array to make sure assets are pushed even when
// scripts is not configured in angular.json
if (!optionsStarter.scripts) {
optionsStarter.scripts = [];
}

if (options.consolelogs) {
// Write the config to a file, and then include that in the bundle so it loads on window
const configPath = getSystemPath(
Expand All @@ -61,9 +67,6 @@ export function prepareBrowserConfig(
options.consolelogsPort
} }`
);
if (!optionsStarter.scripts) {
optionsStarter.scripts = [];
}
optionsStarter.scripts.push({
input: configPath,
bundleName: 'consolelogs',
Expand Down

0 comments on commit c8bb37b

Please sign in to comment.