@userfrosting/gulp-bundle-assets
Advanced tools
Comparing version 4.0.0-rc.0 to 4.0.0-rc.1
@@ -10,2 +10,7 @@ # Changelog | ||
## [4.0.0-rc.1] - 2020-02-22 | ||
### Added | ||
- Including bundle type in logging. | ||
## [4.0.0-rc.0] - 2020-02-21 | ||
@@ -12,0 +17,0 @@ |
@@ -17,3 +17,3 @@ import Vinyl from "vinyl"; | ||
*/ | ||
function bundleFactory(name, rawPaths, cwd, joiner, logger) { | ||
function bundleFactory(name, type, rawPaths, cwd, joiner, logger) { | ||
const paths = []; | ||
@@ -26,3 +26,3 @@ for (const rawPath of rawPaths) { | ||
} | ||
return new Bundle(name, paths, joiner, logger); | ||
return new Bundle(name, type, paths, joiner, logger); | ||
} | ||
@@ -88,3 +88,3 @@ /** | ||
this.logger.trace("Starting processing of script paths"); | ||
this.scriptBundles.add(bundleFactory(name, bundle.scripts, cwd, joiner.Scripts, this.logger)); | ||
this.scriptBundles.add(bundleFactory(name, "script", bundle.scripts, cwd, joiner.Scripts, this.logger)); | ||
this.logger.trace("Completed processing of script paths"); | ||
@@ -95,3 +95,3 @@ } | ||
this.logger.trace("Starting processing of style paths"); | ||
this.styleBundles.add(bundleFactory(name, bundle.styles, cwd, joiner.Styles, this.logger)); | ||
this.styleBundles.add(bundleFactory(name, "style", bundle.styles, cwd, joiner.Styles, this.logger)); | ||
this.logger.trace("Completed processing of style paths"); | ||
@@ -98,0 +98,0 @@ } |
@@ -16,2 +16,3 @@ /// <reference types="node" /> | ||
} | ||
export declare type BundleType = "style" | "script"; | ||
/** | ||
@@ -22,2 +23,3 @@ * Represents a bundle to be bundled, assists in process. | ||
readonly name: string; | ||
private readonly type; | ||
private readonly initialPaths; | ||
@@ -33,3 +35,3 @@ private remainingPaths; | ||
*/ | ||
constructor(name: string, paths: string[], streamFactory: BundleStreamFactory, logger: Logger); | ||
constructor(name: string, type: BundleType, paths: string[], streamFactory: BundleStreamFactory, logger: Logger); | ||
/** | ||
@@ -36,0 +38,0 @@ * Takes a file and returns a Vinyl instance or false depending on if requirements have been met. |
@@ -13,5 +13,6 @@ import Vinyl from "vinyl"; | ||
*/ | ||
constructor(name, paths, streamFactory, logger) { | ||
constructor(name, type, paths, streamFactory, logger) { | ||
this.files = new Map(); | ||
this.name = name; | ||
this.type = type; | ||
this.initialPaths = paths.slice(0); | ||
@@ -23,2 +24,3 @@ this.remainingPaths = paths.slice(0); | ||
bundleName: this.name, | ||
type: this.type, | ||
files: this.initialPaths, | ||
@@ -41,2 +43,3 @@ }); | ||
bundleName: this.name, | ||
type: this.type, | ||
path: file.path, | ||
@@ -48,2 +51,3 @@ }); | ||
bundleName: this.name, | ||
type: this.type, | ||
path: file.path, | ||
@@ -65,5 +69,6 @@ }); | ||
bundleName: this.name, | ||
type: this.type, | ||
inFiles: this.initialPaths, | ||
}); | ||
this.logger.info("Started bundling", { bundleName: this.name }); | ||
this.logger.info("Started bundling", { bundleName: this.name, type: this.type }); | ||
const chunks = await getStream.array(this.streamFactory(intoStream.object(orderedFiles), this.name)); | ||
@@ -75,2 +80,3 @@ // Verify results are all Vinyl instances | ||
bundleName: this.name, | ||
type: this.type, | ||
chunk, | ||
@@ -82,4 +88,4 @@ }); | ||
// Perform bundling, and collect results | ||
this.logger.trace("Bundle stream completed", { bundleName: this.name }); | ||
this.logger.info("Finished bundling", { bundleName: this.name }); | ||
this.logger.trace("Bundle stream completed", { bundleName: this.name, type: this.type }); | ||
this.logger.info("Finished bundling", { bundleName: this.name, type: this.type }); | ||
return chunks; | ||
@@ -86,0 +92,0 @@ } |
{ | ||
"name": "@userfrosting/gulp-bundle-assets", | ||
"version": "4.0.0-rc.0", | ||
"version": "4.0.0-rc.1", | ||
"description": "Orchastrates JS and CSS bundle creation in an efficient and configurable manner.", | ||
@@ -5,0 +5,0 @@ "funding": "https://opencollective.com/userfrosting", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
75681
690