diff --git a/webpack.workers.config.js b/webpack.workers.config.js index 4d40625c..fd506b00 100644 --- a/webpack.workers.config.js +++ b/webpack.workers.config.js @@ -43,12 +43,9 @@ module.exports = async ( options: { replace: `(() => { const path = require("path"); -const IS_PACKAGED = __dirname.indexOf("/resources/workers/") > -1; -throw Error(\`__dirname=\${__dirname} // process.resourcesPath=\${process.resourcesPath} // process.cwd()=\${process.cwd()}\`); +const IS_PACKAGED = __dirname.indexOf(path.join("resources/workers/")) > -1; -return IS_PACKAGED - ? path.resolve(process.resourcesPath, "natives/classic-level/") - : path.resolve(process.cwd(), "node_modules/classic-level/");; +return path.resolve(process.cwd(), IS_PACKAGED ? "resources/natives/" : "node_modules/", "classic-level/"); })()`, search: "__dirname", },