Skip to content

Commit c8bb37b

Browse files
dirkgroenenimhoffd
authored andcommitted
fix(cordova): add cordova.js to index.html even without scripts array
Fixes #188
1 parent 4bea3a4 commit c8bb37b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

builders/utils/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export function prepareBrowserConfig(
4646
optionsStarter.deleteOutputPath = false;
4747
}
4848

49+
// Initialize an empty script array to make sure assets are pushed even when
50+
// scripts is not configured in angular.json
51+
if (!optionsStarter.scripts) {
52+
optionsStarter.scripts = [];
53+
}
54+
4955
if (options.consolelogs) {
5056
// Write the config to a file, and then include that in the bundle so it loads on window
5157
const configPath = getSystemPath(
@@ -61,9 +67,6 @@ export function prepareBrowserConfig(
6167
options.consolelogsPort
6268
} }`
6369
);
64-
if (!optionsStarter.scripts) {
65-
optionsStarter.scripts = [];
66-
}
6770
optionsStarter.scripts.push({
6871
input: configPath,
6972
bundleName: 'consolelogs',

0 commit comments

Comments
 (0)