mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 06:00:21 +08:00
dev: add emulator prod deployment
This commit is contained in:
parent
dfb2523bd6
commit
6ec3c8b653
@ -1,5 +1,9 @@
|
|||||||
"use strict";
|
"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 { XDocumentPTT } = require("../../phoenix/src/pty/XDocumentPTT");
|
||||||
const {
|
const {
|
||||||
NewWispPacketStream,
|
NewWispPacketStream,
|
||||||
@ -132,15 +136,15 @@ window.onload = async function()
|
|||||||
);
|
);
|
||||||
const arrayBuffer = await resp.arrayBuffer();
|
const arrayBuffer = await resp.arrayBuffer();
|
||||||
var emulator = window.emulator = new V86({
|
var emulator = window.emulator = new V86({
|
||||||
wasm_path: "/vendor/v86/v86.wasm",
|
wasm_path: PATH_V86 + "/v86.wasm",
|
||||||
memory_size: 512 * 1024 * 1024,
|
memory_size: 512 * 1024 * 1024,
|
||||||
vga_memory_size: 2 * 1024 * 1024,
|
vga_memory_size: 2 * 1024 * 1024,
|
||||||
screen_container: document.getElementById("screen_container"),
|
screen_container: document.getElementById("screen_container"),
|
||||||
bios: {
|
bios: {
|
||||||
url: "/vendor/v86/bios/seabios.bin",
|
url: PATH_V86 + "/bios/seabios.bin",
|
||||||
},
|
},
|
||||||
vga_bios: {
|
vga_bios: {
|
||||||
url: "/vendor/v86/bios/vgabios.bin",
|
url: PATH_V86 + "/bios/vgabios.bin",
|
||||||
},
|
},
|
||||||
|
|
||||||
initrd: {
|
initrd: {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
const DefinePlugin = require('webpack').DefinePlugin;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: [
|
entry: [
|
||||||
@ -8,5 +9,8 @@ module.exports = {
|
|||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: 'assets/template.html'
|
template: 'assets/template.html'
|
||||||
}),
|
}),
|
||||||
|
new DefinePlugin({
|
||||||
|
MODE: JSON.stringify(process.env.MODE ?? 'dev')
|
||||||
|
}),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user