diff --git a/analyze/index.ts b/analyze/index.ts index 38a9222c..2b6955ec 100644 --- a/analyze/index.ts +++ b/analyze/index.ts @@ -4,6 +4,7 @@ import { Schema } from './schema'; import util from 'util'; import { exec } from 'child_process'; import fs from 'fs'; +import { explore } from 'source-map-explorer'; export const execAsync = util.promisify(exec); @@ -17,7 +18,7 @@ export default createBuilder( const overrides = { // this is an example how to override the workspace set of options - ...({ sourceMap: true }) + ...({ sourceMap: true }) }; @@ -34,11 +35,15 @@ export default createBuilder( const mainFile = file.find(f => f.endsWith('.js')); console.log(mainFile); - const commandToPublish = `source-map-explorer ${builderConfig.outputPath}/${mainFile}`; + // const commandToPublish = `source-map-explorer ${builderConfig.outputPath}/${mainFile}`; - const { stdout, stderr } = await execAsync(commandToPublish); - context.logger.info(stdout); - context.logger.info(stderr); + // const { stdout, stderr } = await execAsync(commandToPublish); + // context.logger.info(stdout); + // context.logger.info(stderr); + + const result = await explore(`${builderConfig.outputPath}/${mainFile}`, { output: { format: 'html' } }); + console.log(result.output); + console.log(result.bundles); } context.reportStatus(`Done.`); diff --git a/package.json b/package.json index bd32884f..bb43c0b8 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "Angular Buidler" ], "author": "Santosh Yadav ", - "license": "ISC", + "license": "MIT", "devDependencies": { "@types/jasmine": "^3.3.12", "@types/node": "^11.15.9", @@ -36,6 +36,7 @@ }, "dependencies": { "@angular-devkit/architect": "^0.800.0-beta.11", - "schematics-utilities": "^2.0.1" + "schematics-utilities": "^2.0.1", + "source-map-explorer": "^2.4.2" } -} \ No newline at end of file +}