- Notifications
You must be signed in to change notification settings - Fork3
unassert-js/rollup-plugin-unassert
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ARollup plugin to remove assertion calls viaUnassert.
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()]};
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.
importunassertfrom'rollup-plugin-unassert';exportdefault{input:'src/index.js',output:{file:'dist/my-lib.js',},plugins:[unassert({exclude:'test/**/**.js',requirePatterns:['assert = require("assert")']})]};
"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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.