Skip to content

Commit a063f9d

Browse files
committed
refactor: move to env variables for rollup
so you can toggle between debug or not
1 parent 3b59f87 commit a063f9d

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

samples/gauge/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Gauge example
2+
3+
This is a simple JavaScript gauge to interface with the WASM module.
4+
5+
## Building
6+
To build to your `Packages` folder and listen to changes (i.e. when you're debugging or quickly prototyping) you can run `npm run dev`. Otherwise, run `npm run build`

samples/gauge/package-lock.json

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/gauge/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build": "npx rollup -c",
8-
"dev": "npx rollup -cw",
7+
"build": "cross-env DEBUG=false npx rollup -c",
8+
"dev": "cross-env DEBUG=true npx rollup -cw",
99
"format": "prettier --write .",
1010
"lint": "eslint --ext ts,tsx ."
1111
},
@@ -19,6 +19,7 @@
1919
"@rollup/plugin-node-resolve": "^15.2.3",
2020
"@typescript-eslint/eslint-plugin": "^6.9.0",
2121
"@typescript-eslint/parser": "^6.9.0",
22+
"cross-env": "^7.0.3",
2223
"esbuild": "^0.19.5",
2324
"eslint": "^8.52.0",
2425
"eslint-config-prettier": "^9.0.0",

samples/gauge/rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import copy from "rollup-plugin-copy"
33
import esbuild from "rollup-plugin-esbuild"
44
import css from "rollup-plugin-import-css"
55

6-
let DEBUG = true
6+
const DEBUG = process.env.DEBUG === 'true';
77

8-
let outputDest = "../../../PackageSources"
8+
let outputDest = "../aircraft/PackageSources"
99
if (DEBUG) {
10-
outputDest = "../../../Packages/navigraph-aircraft-updater-sample"
10+
outputDest = "../aircraft/Packages/navigraph-aircraft-updater-sample"
1111
}
1212

1313
export default {

0 commit comments

Comments
 (0)