Skip to content

Commit 6b27d0d

Browse files
feat: analyse all bundles
fixes #41
1 parent abb9e2d commit 6b27d0d

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

analyze/index.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,7 @@ export default createBuilder<any>(
3030
const result = await build.result;
3131

3232
if (result.success) {
33-
const file = fs.readdirSync(builderConfig.outputPath).filter(f => f.includes('es2015'));
34-
const filesToRemove = file.filter(f => f.includes('polyfills') || f.includes('runtime'));
35-
let filesToShow = file.filter(f => !filesToRemove.includes(f) && f.endsWith('.js'));
36-
37-
let mainFile = filesToShow[0];
38-
let promptAvailableBundles;
39-
40-
if (filesToShow.length > 1) {
41-
promptAvailableBundles = await inquirer
42-
.prompt([
43-
{
44-
type: 'list',
45-
name: 'bundleName',
46-
message: 'Select the bundle to run the analyzer?',
47-
choices: filesToShow,
48-
},
49-
])
50-
.catch(error => {
51-
context.logger.info(error);
52-
});
53-
54-
mainFile = promptAvailableBundles.bundleName;
55-
}
56-
33+
const mainFile = '*es2015.*.js';
5734
const explorerCommand = `npx source-map-explorer ${builderConfig.outputPath}/${mainFile}`;
5835
const { stdout, stderr } = await execAsync(explorerCommand);
5936
context.logger.info(stdout);

0 commit comments

Comments
 (0)