Skip to content

Commit c217aad

Browse files
authored
Fix/build output layout (#3716)
* fix: `ol.css` for nwjs build * fix: global vars broken by race condition * fix: only copy node modules css
1 parent 259d2ea commit c217aad

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,14 @@ function dist_src() {
380380

381381
function dist_node_modules_css() {
382382
return gulp
383-
.src("./**/*.min.css")
384-
.pipe(gulp.dest(DIST_DIR));
383+
.src("./node_modules/**/*.min.css")
384+
.pipe(gulp.dest(`${DIST_DIR}node_modules`));
385385
}
386386

387387
function dist_ol_css() {
388388
return gulp
389389
.src("./node_modules/ol/ol.css", { base: "node_modules" })
390-
.pipe(gulp.dest(DIST_DIR));
390+
.pipe(gulp.dest(`${DIST_DIR}css/tabs/`));
391391
}
392392

393393
function dist_less() {

src/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,5 @@ <h3 class="dialogInformationTitle"></h3>
337337
<a href="#" class="dialogInformation-confirmButton regular-button"></a>
338338
</div>
339339
</dialog>
340-
<!-- CORDOVA_INCLUDE cordova.js -->
341340
</body>
342341
</html>

src/js/main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ function readConfiguratorVersionMetadata() {
5656
CONFIGURATOR.version = manifest.version;
5757
CONFIGURATOR.gitRevision = manifest.gitRevision;
5858
} else {
59-
CONFIGURATOR.productName = __APP_PRODUCTNAME__;
60-
CONFIGURATOR.version = __APP_VERSION__;
61-
CONFIGURATOR.gitRevision = __APP_REVISION__;
59+
// These are injected by vite. If not checking
60+
// for undefined occasionally there is a race
61+
// condition where this fails the nwjs and cordova builds
62+
CONFIGURATOR.productName = typeof __APP_PRODUCTNAME__ !== 'undefined' ? __APP_PRODUCTNAME__ : 'Betaflight Configurator';
63+
CONFIGURATOR.version = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : '0.0.0';
64+
CONFIGURATOR.gitRevision = typeof __APP_REVISION__ !== 'undefined' ? __APP_REVISION__ : 'unknown';
6265
}
6366
}
6467

0 commit comments

Comments
 (0)