From 9293bece83b84e2182ae50dbc508dd88f4e20073 Mon Sep 17 00:00:00 2001 From: alexjanousekGSA Date: Tue, 10 Jun 2025 20:24:08 -0400 Subject: [PATCH] Added config --- gulpfile.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ec1c6c7dc..533ca6f6f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -125,9 +125,14 @@ const copyUSWDSJS = () => { .pipe(dest(paths.dist + 'js/')); }; - // Configure USWDS paths uswds.settings.version = 3; +uswds.settings.compile = { + sass: true, + javascript: true, + sprites: false +}; + uswds.paths.dist.css = paths.dist + 'css'; uswds.paths.dist.js = paths.dist + 'js'; uswds.paths.dist.img = paths.dist + 'img'; @@ -140,17 +145,22 @@ const styles = async () => { await uswds.compile(); }; -// Task to copy USWDS assets + // Task to copy USWDS assetsconst const copyUSWDSAssets = () => { return src([ 'node_modules/@uswds/uswds/dist/img/**/*', 'node_modules/@uswds/uswds/dist/fonts/**/*' ], { encoding: false }) - .pipe(dest(paths.dist + 'img/')) - .pipe(dest(paths.dist + 'fonts/')); + .pipe(dest((file) => { + if (file.path.includes('/img/')) { + return paths.dist + 'img/'; + } else if (file.path.includes('/fonts/')) { + return paths.dist + 'fonts/'; + } + return paths.dist; + })); }; - // Optional backstopJS task // Install gulp globally and run `gulp backstopTest` const backstopTest = (done) => {