Fix Windows paths for new plugin runtime

This commit is contained in:
Gregory Schier
2024-08-09 12:43:56 -07:00
parent 331f1eb9b9
commit 48c239b7dc
3 changed files with 1952 additions and 1932 deletions

View File

@@ -8,9 +8,11 @@ import { parentPort, workerData } from 'node:worker_threads';
new Promise<void>(async (resolve, reject) => {
const { pluginDir /*, pluginRefId*/ } = workerData;
const pathMod = path.join(pluginDir, 'build/index.js');
const pathPkg = path.join(pluginDir, 'package.json');
// NOTE: Use POSIX join because require() needs forward slash
const pathMod = path.posix.join(pluginDir, 'build', 'index.js');
let pkg: { [x: string]: any };
try {
pkg = JSON.parse(readFileSync(pathPkg, 'utf8'));