@userfrosting/ts-log-adapter-gulplog
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ts-log-adapter-gulplog

Branch Status
master Continuous Integration codecov

An adapter for the ts-log interface that pushes logging to gulplog.

Before being passed to gulplog, the message optional arguments will be processed to ensure proper logging. The trace log level does not map across and will be directed to GulpLog.debug with TRACE: prefixed to logging.

Install

npm i -D  @userfrosting/ts-log-adapter-gulplog

Usage

// gulpfile.mjs
import { GulpLogLogger } from "@userfrosting/ts-log-adapter-gulplog";
import { src, dest } from "gulp";
import AssetBundler from "@userfrosting/gulp-bundle-assets";
import cleanCss from "gulp-clean-css";
import concatCss from "gulp-concat-css";
import concatJs from "gulp-concat-js";
import uglify from "gulp-uglify";

export function bundle() {
    const config = {
        bundle: {
            example: {
                scripts: [
                    "foo.js",
                    "bar.js"
                ],
                styles: [
                    "foo.css",
                    "bar.css"
                ]
            }
        },
        logger: new GulpLogLogger(),
    };
    const joiner = {
        Scripts(bundleStream, name) {
            return bundleStream
                .pipe(concatJs(name + ".js"))// example.js
                .pipe(uglify());
        },
        Styles(bundleStream, name) {
            return bundleStream
                .pipe(concatCss(name + ".css"))// example.css
                .pipe(cleanCss());
        }
    };

    return src("src/**")
        .pipe(new AssetBundler(config, joiner))
        .pipe(dest("public/assets/"));
}
$ gulp bundle

API

See docs/api.

License

MIT

Contributing

See CONTRIBUTING.md.

Package Sidebar

Install

npm i @userfrosting/ts-log-adapter-gulplog

Weekly Downloads

29

Version

1.0.0

License

MIT

Unpacked Size

17.2 kB

Total Files

17

Last publish

Collaborators

  • lcharette
  • alexweissman
  • siliconsoldier