@entur-partner/parcel-reporter-assets
Advanced tools
Comparing version 0.0.7 to 0.0.9
22
index.js
@@ -10,16 +10,16 @@ const path = require('path'); | ||
if (event.type === 'buildSuccess' && options.mode === 'production') { | ||
let { bundleGraph } = event; | ||
let js = [], | ||
const { bundleGraph } = event; | ||
const js = [], | ||
css = []; | ||
let distDir = path.join(options.projectRoot, 'dist'); | ||
for (let bundle of bundleGraph.getBundles()) { | ||
let value = path.join(bundle.target.publicUrl, bundle.name); | ||
for (const bundle of bundleGraph.getBundles()) { | ||
const value = path.join(bundle.target.publicUrl, bundle.name); | ||
distDir = bundle.target.distDir; | ||
if (bundle.type === 'js') { | ||
let packageJSON = await bundle.getMainEntry().getPackage(); | ||
const packageJSON = await bundle.getMainEntry().getPackage(); | ||
if (bundle.name.includes(packageJSON.name)) { | ||
js.push({ | ||
value, | ||
type: 'entry' | ||
type: 'entry', | ||
}); | ||
@@ -29,3 +29,3 @@ } else { | ||
value, | ||
type: 'lazy' | ||
type: 'lazy', | ||
}); | ||
@@ -37,7 +37,7 @@ } | ||
} | ||
let assetsFilePath = path.join(distDir, 'assets.json'); | ||
let content = JSON.stringify({ js, css }, undefined, 2); | ||
const assetsFilePath = path.join(distDir, 'assets.json'); | ||
const content = JSON.stringify({ js, css }, undefined, 2); | ||
await options.outputFS.writeFile(assetsFilePath, content); | ||
let formattedFilename = formatFilename( | ||
const formattedFilename = formatFilename( | ||
assetsFilePath || '', | ||
@@ -49,3 +49,3 @@ chalk.cyan.bold | ||
} | ||
} | ||
}, | ||
}); |
{ | ||
"name": "@entur-partner/parcel-reporter-assets", | ||
"version": "0.0.7", | ||
"version": "0.0.9", | ||
"license": "EUPL-1.2", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "1859fe88cfe5b475b3d102970b908817c97018c3" | ||
"gitHead": "11c534c51b081aebb0933481e4ebbecc8c3c5732" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2042