Skip to content

Commit

Permalink
Merge pull request #1116 from userfrosting/hotfix-assets-update
Browse files Browse the repository at this point in the history
Hotfix assets update
  • Loading branch information
lcharette authored Nov 15, 2020
2 parents ac46354 + 67cd084 commit 9467ddf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Remove whitespace at top of page templates ([#1107])
- Deep extend when adding global query params in ufTable ([#1114])
- Check for null key in Unique::buildTertiaryDictionary ([#1109])
- Client-side assets containing glob characters causing crashes when building assets.
- Fixed issue where merging of package dependencies would show as "undefined", resulting in debugging challenges where there are issues.

## [v4.4.3]

Expand Down
7 changes: 4 additions & 3 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"dependencies": {
"@userfrosting/browserify-dependencies": "^3.1.0",
"@userfrosting/gulp-bundle-assets": "^4.0.1",
"@userfrosting/merge-package-dependencies": "^1.2.1",
"@userfrosting/vinyl-fs-vpath": "^1.0.0",
"@userfrosting/merge-package-dependencies": "^2.1.0",
"@userfrosting/vinyl-fs-vpath": "^2.0.0",
"bower": "^1.8.8",
"del": "^5.1.0",
"del": "^6.0.0",
"dotenv": "^8.2.0",
"esm": "^3.2.25",
"gulp": "^4.0.2",
Expand All @@ -16,6 +16,7 @@
"gulp-if": "^3.0.0",
"gulp-prune": "^0.2.0",
"gulp-rev": "^9.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-terser": "^1.2.0",
"gulplog": "^1.0.0",
"strip-ansi": "^6.0.0"
Expand Down
19 changes: 8 additions & 11 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { readFileSync, writeFileSync } from "fs";
import { src } from "@userfrosting/vinyl-fs-vpath";
import { Logger, vendorAssetsDir, sprinklesDir, sprinkles, sprinkleBundleFile, publicAssetsDir } from "./util.js";
import gulpIf from "gulp-if";
import gulpSourcemaps from "gulp-sourcemaps";

/**
* Compiles frontend assets. Mapped to npm script "uf-bundle".
Expand Down Expand Up @@ -135,11 +136,15 @@ export function build() {

// Open stream
log.info("Starting bundle process proper...");
return src({ globs: sources, pathMappings, base: publicAssetsDir, sourcemaps: true })
return src({ globs: sources, pathMappings, base: publicAssetsDir })
.pipe(gulpSourcemaps.init({ loadMaps: true }))
.pipe(gulpIf(stylesAndScriptsFilter, new Bundler(rawConfig, bundleBuilder, resultsCallback)))
.pipe(prune(publicAssetsDir))
.pipe(gulpIf(stylesAndScriptsFilter, gulp.dest(publicAssetsDir, { sourcemaps: "." })))
.pipe(gulpIf(everythingElseFilter, gulp.dest(publicAssetsDir)));
.pipe(gulpIf(
stylesAndScriptsFilter,
gulp.dest(publicAssetsDir, { sourcemaps: true }),
gulp.dest(publicAssetsDir)
));
};

/**
Expand All @@ -165,11 +170,3 @@ function stylesFilter(fs) {
function scriptsFilter(fs) {
return fs.extname === ".js";
}

/**
* Used to filter to everything but styles and scripts.
* @param {import("vinyl").NullFile} fs
*/
function everythingElseFilter(fs) {
return (fs.extname !== ".js") && (fs.extname !== ".css");
}

0 comments on commit 9467ddf

Please sign in to comment.