Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

unassert-js/gulp-unassert

Repository files navigation

Agulp plugin forunassert.

unassert

Build StatusNPM versionCode StyleLicense

Description

gulp-unassert is agulp plugin forunassert: Encouragesprogramming with assertions by providing tools to compile them away.

Related modules

Install

npm install --save-dev gulp-unassert

Usage

gulp 3.x

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

gulp 4.x

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

custom unassert options

const{ src, dest}=require('gulp');constunassert=require('gulp-unassert');functionbuild(){returnsrc('./src/*.js').pipe(unassert({modules:['assert','assert/strict','node:assert','node:assert/strict','invariant','uvu/assert']})).pipe(dest('./dist'));}exports.build=build;

Source maps

gulp 3.x

gulp-unassert can be used withgulp-sourcemaps to generate source maps for the transformed javascript code. Note that you shouldinit gulp-sourcemaps prior to running the gulp-unassert andwrite the source maps after. gulp-unassert works well with some gulp plugins that supportsgulp-sourcemaps.

constunassert=require('gulp-unassert');constcoffee=require('gulp-coffee');constconcat=require('gulp-concat');constsourcemaps=require('gulp-sourcemaps');gulp.task('build',()=>{// compile, instrument then concatinategulp.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, seegulp-sourcemaps.

gulp 4.x

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

const{ src, dest}=require('gulp');constunassert=require('gulp-unassert');constcoffee=require('gulp-coffee');constconcat=require('gulp-concat');functionbuild(){returnsrc('./src/*.coffee',{sourcemaps:true}).pipe(coffee({bare:true})).pipe(unassert()).pipe(concat('bundle.js')).pipe(dest('./build'));}exports.build=build;

Changelog

SeeCHANGELOG

Author

Our Support Policy

We support Node under maintenance. In other words, we stop supporting old Node version whentheir 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.

License

Licensed under theMIT license.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp