#annotation-loader
webpack annotation loader
npm install --save-dev annotation-loader
for test.js
var foo = {};
/*@bar*/
console.log('bar');
/*@/bar*/
var bar = {};
/*@bar2*/
console.log('bar2');
/*@/bar2*/
with config
var webpack = require('webpack');
module.exports = {
entry: './entry.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /^.*$/,
loader: "annotation",
annotations: [
{
'for': 'bar',
'do': ''
},
{
'for': 'bar2',
'do': function (str, $1) {
//$1 is content of annotation
return '//annotation removed';
}
}
]
}
]
}
};
you get
var foo = {};
var bar = {};
//annotation removed
Use to remove tests exports or some code for dev mode in production
##Licence
MIT