babel-plugin-transform-require-stub
Started as a fork of babel-plugin-transform-require-ignore
Ever wanted to test Webpacked frontend code... without webpack?
Well this lets you do just that, by stubbing out required files with specified extensions in your code, to achieve creating stubs where a webpack loader would be called.
Installation
npm install --save-dev babel-plugin-transform-require-stub
Usage
Add the plugin to your .babelrc or package.json with a config like so:
{
"plugins": [
[
"babel-plugin-transform-require-stub",
{
"extensions": [
".png", ".sass", ".styl"
],
"defaultStub": {
"file": "./fileToStub"
},
".sass": {
"path": true
},
".styl": {
"value": {
"something": "here"
}
}
}
]
]
}
License
MIT