unless
Examples
{ }
expands to
if !foo { }
return foo
expands to
if !bar return foo
foo
expands to
if !bar { foo }
Installation
-
$ npm install --save unless-macro
. -
Load using sweetjs-loader like,
// webpack.config.jsmoduleexports = cache: true entry: 'app.js' output: filename: 'bundle.js' module: loaders: test: /\.js$/ loader: 'sweetjs?modules[]=unless-macro/unless.sjs' ;
to expand the macro at build time.