Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile custom javascript files @uswds3.0 #58

Open
renudusa opened this issue Apr 5, 2023 · 1 comment
Open

Compile custom javascript files @uswds3.0 #58

renudusa opened this issue Apr 5, 2023 · 1 comment
Labels
Affects: Build Relates to the build process Affects: Compiling Related to compiling Sass or JavaScript Context: JavaScript Issue is in JavaScript Enhancement New feature or request Type: Feature Request New functionality

Comments

@renudusa
Copy link

renudusa commented Apr 5, 2023

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 version
    */

uswds.settings.version = 3;

/**

  • Path settings
  • Set as many as you need
    */

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
  • Add as many as you need
    */

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

Any help is appreciated

@mejiaj mejiaj added the Enhancement New feature or request label Apr 28, 2023
@mejiaj
Copy link
Contributor

mejiaj commented Apr 28, 2023

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

@mejiaj mejiaj moved this to Voting Open in USWDS Core Project Data Jun 22, 2023
@mejiaj mejiaj added Type: Feature Request New functionality Affects: Build Relates to the build process Affects: Compiling Related to compiling Sass or JavaScript Context: JavaScript Issue is in JavaScript labels Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Build Relates to the build process Affects: Compiling Related to compiling Sass or JavaScript Context: JavaScript Issue is in JavaScript Enhancement New feature or request Type: Feature Request New functionality
Projects
Status: Voting Open
Development

No branches or pull requests

2 participants