Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Dec 11, 2024
1 parent 4cb0193 commit 679a9f1
Show file tree
Hide file tree
Showing 8 changed files with 921 additions and 66 deletions.
21 changes: 19 additions & 2 deletions build/npm/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function npmInstall(dir, opts) {
log(dir, 'Installing dependencies...');
run(npm, command.split(' '), opts);
}
removeParcelWatcherPrebuild(dir);
}

function setNpmrcConfig(dir, env) {
Expand Down Expand Up @@ -96,11 +97,27 @@ function setNpmrcConfig(dir, env) {
}
}

function removeParcelWatcherPrebuild(dir) {
const parcelModuleFolder = path.join(root, dir, 'node_modules', '@parcel');
if (!fs.existsSync(parcelModuleFolder)) {
return;
}

const parcelModules = fs.readdirSync(parcelModuleFolder);
for (const moduleName of parcelModules) {
if (moduleName.startsWith('watcher-')) {
const modulePath = path.join(parcelModuleFolder, moduleName);
fs.rmSync(modulePath, { recursive: true, force: true });
log(dir, `Removed @parcel/watcher prebuilt module ${modulePath}`);
}
}
}

for (let dir of dirs) {

if (dir === '') {
// already executed in root
continue;
removeParcelWatcherPrebuild(dir);
continue; // already executed in root
}

let opts;
Expand Down
325 changes: 308 additions & 17 deletions extensions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 679a9f1

Please sign in to comment.