felixge / node-sandboxed-module

A sandboxed node.js module loader that lets you inject dependencies into your modules.
MIT License
342 stars 42 forks source link

Allow filtering of files transformed by built-in source transformers. #59

Open m-orchard opened 8 years ago

m-orchard commented 8 years ago

Hi,

This is related to and based on https://github.com/felixge/node-sandboxed-module/pull/58.

This allows you to specify a regex when registering built-in source transformers, which will cause transformers only to be ran of files than match the regex.

This was useful to us, to prevent istanbul coverage being generated for files we didn't want (e.g. node_modules).

This PR does have tests - hopefully they are sufficient - but since the branch is based on https://github.com/felixge/node-sandboxed-module/pull/58 then you may not want to merge it until that also has tests.

Cheers!