Skip to content

Compile custom javascript files @uswds3.0 #58

@renudusa

Description

@renudusa

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    On Hold

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions