1.0.1 • Published 6 years ago

require-noop-register v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

require-noop-register

npm npm GitHub issues

Travis David

Inhibits require on selected extensions.

Useful in isomorphic setups, where - for instance - we want require('asset.png') to use a webpack loader on the client, but result in a noop on the server.

Install

npm install --save-dev require-noop-register

Usage in mocha

From the CLI

mocha --require require-noop-register

In the mocha.opts

--require require-noop-register

If you don't want it to apply to all supported extensions, you may register individual groups or extensions using something like:

--require require-noop-register/css
--require require-noop-register/stylesheets

The currently supported extensions are:

ExtensionGroup
cssstylesheets
lessstylesheets
scssstylesheets
gifgraphics
jpggraphics
pnggraphics
pdfdocuments