-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmach.config.js
62 lines (59 loc) · 1.97 KB
/
mach.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const imageInline = require("esbuild-plugin-inline-image");
const postCssPlugin = require("esbuild-style-plugin");
const postCssColorFunctionalNotation = require("postcss-color-functional-notation");
const postCssInset = require("postcss-inset");
const { sassPlugin } = require("esbuild-sass-plugin");
const envFilePlugin = require("esbuild-envfile-plugin");
/** @type { import('@synaptic-simulations/mach').MachConfig } */
module.exports = {
packageName: "e-170",
packageDir: "PackageSources",
plugins: [
envFilePlugin,
imageInline({ limit: -1 }),
postCssPlugin({
extract: true,
postcss: {
plugins: [postCssColorFunctionalNotation(), postCssInset()],
},
}),
sassPlugin(),
],
instruments: [
msfsAvionicsInstrument("PFD"),
msfsAvionicsInstrument("RadioSelector"),
msfsAvionicsInstrument("Clock"),
msfsAvionicsInstrument("IES"),
msfsAvionicsInstrument("EICAS"),
// reactInstrument('MultifunctionControlDisplay', undefined, false), most likely needs to me in MSFS framework too
reactInstrument("MFD", undefined, true), // needs to be converted to avionics framework
reactInstrument("ElectronicFlightBag", undefined, true), // only react instrument hopefully
// reactInstrument('DU-1310-2-PFD', undefined, true),
// reactInstrument('DU-1310-2-MFD', undefined, true),
],
};
function reactInstrument(name, additionalImports, isInteractive) {
return {
name,
index: `src/${name}/index.tsx`,
simulatorPackage: {
type: "react",
isInteractive: isInteractive ?? false,
fileName: name.toLowerCase(),
imports: ["/JS/dataStorage.js", ...(additionalImports ?? [])],
},
};
}
function msfsAvionicsInstrument(name, folder = name) {
return {
name,
index: `src/${folder}/instrument.tsx`,
simulatorPackage: {
type: "baseInstrument",
templateId: `E170_${name}`,
mountElementId: `${name}_CONTENT`,
fileName: name.toLowerCase(),
imports: [],
},
};
}