Skip to content

Commit

Permalink
dev: add emulator prod deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Sep 18, 2024
1 parent dfb2523 commit 6ec3c8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/emulator/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"use strict";

console.log(`emulator running in mode: ${MODE}`)

const PATH_V86 = MODE === 'dev' ? '/vendor/v86' : './vendor/v86';

const { XDocumentPTT } = require("../../phoenix/src/pty/XDocumentPTT");
const {
NewWispPacketStream,
Expand Down Expand Up @@ -132,15 +136,15 @@ window.onload = async function()
);
const arrayBuffer = await resp.arrayBuffer();
var emulator = window.emulator = new V86({
wasm_path: "/vendor/v86/v86.wasm",
wasm_path: PATH_V86 + "/v86.wasm",
memory_size: 512 * 1024 * 1024,
vga_memory_size: 2 * 1024 * 1024,
screen_container: document.getElementById("screen_container"),
bios: {
url: "/vendor/v86/bios/seabios.bin",
url: PATH_V86 + "/bios/seabios.bin",
},
vga_bios: {
url: "/vendor/v86/bios/vgabios.bin",
url: PATH_V86 + "/bios/vgabios.bin",
},

initrd: {
Expand Down
4 changes: 4 additions & 0 deletions src/emulator/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const DefinePlugin = require('webpack').DefinePlugin;

module.exports = {
entry: [
Expand All @@ -8,5 +9,8 @@ module.exports = {
new HtmlWebpackPlugin({
template: 'assets/template.html'
}),
new DefinePlugin({
MODE: JSON.stringify(process.env.MODE ?? 'dev')
}),
]
};

0 comments on commit 6ec3c8b

Please sign in to comment.