2022-02-08 11:35:00 -07:00
|
|
|
const { workspace } = require('../workspace');
|
2022-04-18 10:31:58 -08:00
|
|
|
const fs = require('fs');
|
2021-10-11 10:52:17 -04:00
|
|
|
const path = require('path');
|
|
|
|
const rimraf = require('rimraf');
|
2022-04-18 10:31:58 -08:00
|
|
|
|
2022-02-08 11:35:00 -07:00
|
|
|
for (const pkg of workspace.packages()) {
|
2022-06-02 17:37:43 -07:00
|
|
|
rimraf.sync(path.join(pkg.path, 'node_modules'));
|
2022-02-08 11:35:00 -07:00
|
|
|
rimraf.sync(path.join(pkg.path, 'lib'));
|
2022-04-18 10:31:58 -08:00
|
|
|
rimraf.sync(path.join(pkg.path, 'src', 'generated'));
|
|
|
|
const bundles = path.join(pkg.path, 'bundles');
|
|
|
|
if (fs.existsSync(bundles) && fs.statSync(bundles).isDirectory()) {
|
|
|
|
for (const bundle of fs.readdirSync(bundles))
|
|
|
|
rimraf.sync(path.join(bundles, bundle, 'node_modules'));
|
|
|
|
}
|
2022-02-08 11:35:00 -07:00
|
|
|
}
|