A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/unassert-js/gulp-unassert below:

unassert-js/gulp-unassert: Gulp plugin for unassert: Encourages programming with assertions by providing tools to compile them away.

A gulp plugin for unassert.

gulp-unassert is a gulp plugin for unassert: Encourages programming with assertions by providing tools to compile them away.

npm install --save-dev gulp-unassert
const unassert = require('gulp-unassert');

gulp.task('build', () => {
  gulp.src('./src/*.js')
    .pipe(unassert())
    .pipe(gulp.dest('./dist'));
});
const { src, dest } = require('gulp');
const unassert = require('gulp-unassert');

function build() {
  return src('./src/*.js')
    .pipe(unassert())
    .pipe(dest('./dist'));
}
exports.build = build;
const { src, dest } = require('gulp');
const unassert = require('gulp-unassert');

function build() {
  return src('./src/*.js')
    .pipe(unassert({
      modules: [
        'assert',
        'assert/strict',
        'node:assert',
        'node:assert/strict',
        'invariant',
        'uvu/assert'
      ]
    }))
    .pipe(dest('./dist'));
}
exports.build = build;

gulp-unassert can be used with gulp-sourcemaps to generate source maps for the transformed javascript code. Note that you should init gulp-sourcemaps prior to running the gulp-unassert and write the source maps after. gulp-unassert works well with some gulp plugins that supports gulp-sourcemaps.

const unassert = require('gulp-unassert');
const coffee = require('gulp-coffee');
const concat = require('gulp-concat');
const sourcemaps = require('gulp-sourcemaps');

gulp.task('build', () => {
  // compile, instrument then concatinate
  gulp.src('./src/**/*.coffee')
    .pipe(sourcemaps.init())
    .pipe(coffee({bare: true}))
    .pipe(unassert())
    .pipe(concat('bundle.js'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('./build'));
  // will write the source maps inline in the code
});

For more information, see gulp-sourcemaps.

In gulp 4, sourcemaps are built-in by default.

const { src, dest } = require('gulp');
const unassert = require('gulp-unassert');
const coffee = require('gulp-coffee');
const concat = require('gulp-concat');

function build() {
  return src('./src/*.coffee', { sourcemaps: true })
    .pipe(coffee({ bare: true }))
    .pipe(unassert())
    .pipe(concat('bundle.js'))
    .pipe(dest('./build'));
}
exports.build = build;

See CHANGELOG

We support Node under maintenance. In other words, we stop supporting old Node version when their maintenance ends.

This means that any other environment is not supported.

NOTE: If gulp-unassert works in any of the unsupported environments, it is purely coincidental and has no bearing on future compatibility. Use at your own risk.

Licensed under the MIT license.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4