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

A Rollup plugin to remove assertion calls via Unassert

NotificationsYou must be signed in to change notification settings

unassert-js/rollup-plugin-unassert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARollup plugin to remove assertion calls viaUnassert.

Usage

Install (npm install --save-dev rollup-plugin-unassert oryarn add --dev rollup-plugin-unassert),then add it to theplugins section of your Rollup config as follows:

importunassertfrom'rollup-plugin-unassert';exportdefault{    ...plugins:[unassert()]};

Available options

This plugin accepts the following options:

  • include: A minimatch pattern or array of minimatch patterns, controlling which files are to be handled by this plugin. By default matches*.js only.
  • exclude: A minimatch pattern or array of minimatch patterns, controlling which files are to be ignored by this plugin. By default it's empty.
  • sourcemap: A boolean controlling whether to handle any existing sourcemaps, defaults totrue. Setting this tofalse will hide the assert calls when debugging the generated bundle.
  • assertionPatterns: as perunassert options.
  • requirePatterns: as perunassert options.
  • importPatterns: as perunassert options.

Example Rollup config

importunassertfrom'rollup-plugin-unassert';exportdefault{input:'src/index.js',output:{file:'dist/my-lib.js',},plugins:[unassert({exclude:'test/**/**.js',requirePatterns:['assert = require("assert")']})]};

License

"THE BEER-WARE LICENSE":ivan@sanchezortega.es wrote this file. As long as you retain this notice youcan do whatever you want with this stuff. If we meet some day, and you thinkthis stuff is worth it, you can buy me a beer in return.

Also, thanks to Takuto Wada forhttps://github.com/unassert-js/unassertify, fromwhich this project takes a lot of the code to wrap unassert.

About

A Rollup plugin to remove assertion calls via Unassert

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp