File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
3
+ console . log ( `emulator running in mode: ${ MODE } ` )
4
+
5
+ const PATH_V86 = MODE === 'dev' ? '/vendor/v86' : './vendor/v86' ;
6
+
3
7
const { XDocumentPTT } = require ( "../../phoenix/src/pty/XDocumentPTT" ) ;
4
8
const {
5
9
NewWispPacketStream,
@@ -132,15 +136,15 @@ window.onload = async function()
132
136
) ;
133
137
const arrayBuffer = await resp . arrayBuffer ( ) ;
134
138
var emulator = window . emulator = new V86 ( {
135
- wasm_path : "/vendor/v86 /v86.wasm",
139
+ wasm_path : PATH_V86 + " /v86.wasm",
136
140
memory_size : 512 * 1024 * 1024 ,
137
141
vga_memory_size : 2 * 1024 * 1024 ,
138
142
screen_container : document . getElementById ( "screen_container" ) ,
139
143
bios : {
140
- url : "/vendor/v86 /bios/seabios.bin",
144
+ url : PATH_V86 + " /bios/seabios.bin",
141
145
} ,
142
146
vga_bios : {
143
- url : "/vendor/v86 /bios/vgabios.bin",
147
+ url : PATH_V86 + " /bios/vgabios.bin",
144
148
} ,
145
149
146
150
initrd : {
Original file line number Diff line number Diff line change 1
1
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
2
+ const DefinePlugin = require ( 'webpack' ) . DefinePlugin ;
2
3
3
4
module . exports = {
4
5
entry : [
@@ -8,5 +9,8 @@ module.exports = {
8
9
new HtmlWebpackPlugin ( {
9
10
template : 'assets/template.html'
10
11
} ) ,
12
+ new DefinePlugin ( {
13
+ MODE : JSON . stringify ( process . env . MODE ?? 'dev' )
14
+ } ) ,
11
15
]
12
16
} ;
You can’t perform that action at this time.
0 commit comments