playwright/utils/build/clean.js

16 lines
570 B
JavaScript
Raw Normal View History

const { workspace } = require('../workspace');
const fs = require('fs');
2021-10-11 17:52:17 +03:00
const path = require('path');
const rimraf = require('rimraf');
for (const pkg of workspace.packages()) {
2022-06-03 03:37:43 +03:00
rimraf.sync(path.join(pkg.path, 'node_modules'));
rimraf.sync(path.join(pkg.path, 'lib'));
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'));
}
}