mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 14:26:10 +00:00
0b39c76c40
This name is easier to understand and more generalizable.
17 lines
371 B
JavaScript
17 lines
371 B
JavaScript
let V86;
|
|
|
|
if (typeof window !== 'undefined') {
|
|
V86 = window.V86;
|
|
} else {
|
|
try {
|
|
const { createRequire } = await import('module');
|
|
const require = createRequire(import.meta.url);
|
|
const NodeV86 = require("../third-party/libv86.js");
|
|
V86 = NodeV86.V86;
|
|
} catch (error) {
|
|
console.error('Failed to load V86 in Node.js environment:', error);
|
|
}
|
|
}
|
|
|
|
export { V86 };
|