From a03916a38b3a17cbf26ec77b8fadf612f299b24c Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Wed, 13 Apr 2022 15:10:31 +0200 Subject: [PATCH 1/2] Hack to undo `__filename` rewriting --- packages/core/package-manager/src/installPackage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/package-manager/src/installPackage.js b/packages/core/package-manager/src/installPackage.js index 0c85d8011f1..f23ba1c36f5 100644 --- a/packages/core/package-manager/src/installPackage.js +++ b/packages/core/package-manager/src/installPackage.js @@ -246,8 +246,14 @@ export function installPackage( ): Promise { if (WorkerFarm.isWorker()) { let workerApi = WorkerFarm.getWorkerApi(); + // TODO this should really be `__filename` but without the rewriting. + let bundlePath = + process.env.PARCEL_BUILD_ENV === 'production' && + !process.env.PARCEL_SELF_BUILD + ? path.join(__dirname, '..', 'lib/index.js') + : __filename; return workerApi.callMaster({ - location: __filename, + location: bundlePath, args: [fs, packageManager, modules, filePath, projectRoot, options], method: '_addToInstallQueue', }); From 8376438fc2e61311ed634a3f85675714b1ff2655 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Wed, 13 Apr 2022 15:09:57 +0200 Subject: [PATCH 2/2] Don't need to copy dev-server template anymore --- gulpfile.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d369fe0b685..3b61057ad4d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -29,10 +29,7 @@ const paths = { '!**/dev-prelude.js', ...IGNORED_PACKAGES, ], - packageOther: [ - 'packages/*/*/src/**/dev-prelude.js', - 'packages/*/dev-server/src/templates/**', - ], + packageOther: ['packages/*/*/src/**/dev-prelude.js'], packageJson: [ 'packages/core/parcel/package.json', 'packages/utils/create-react-app/package.json',