uswds / uswds-compile

Simple Gulp 5 functions for copying USWDS static assets and transforming USWDS Sass into browser-readable CSS.
Other
20 stars 12 forks source link

Compile custom javascript files @uswds3.0 #58

Open renudusa opened 1 year ago

renudusa commented 1 year ago

Hello..

Can you please advise how to compile custom javascript files? So far, no issue with compiling scss files.

Lando.yml:

build-sass: description: Run sass compiler within node service cmd: cd /app/web/themes/custom/mytheme/ && npx gulp compile watch-sass: service: node description: Run sass compiler within node service cmd: cd /app/web/themes/custom/mytheme && npx gulp watch

lando watch-sass:

gulpfile.js

/ gulpfile.js /

const uswds = require("@uswds/compile");

/**

uswds.settings.version = 3;

/**

uswds.paths.dist.css = './files/css'; uswds.paths.dist.theme = './sass'; //custom styles

uswds.paths.dist.js = './assets/js'; uswds.paths.src.js = './js'; //custom scripts // const copy = { // js() { // log( // colors.blue, // Copy USWDS compiled JS: ${getSrcFrom("js")} → ${uswds.paths.src.js} // ); // return src(${getSrcFrom("js")}/**/**.replace("//", "/")).pipe( // dest(uswds.paths.dist.js) // ); // }, // };

/**

exports.init = uswds.init; exports.compile = uswds.compile; exports.watch = uswds.watch; exports.copyJS = uswds.copyJS;

Any help is appreciated

mejiaj commented 1 year ago

@renudusa that feature isn't currently available in @USWD/Compile, yet. I've marked this as a potential enhancement for the future.