This is a preprocesser for the webpack module bundler. It support the ' if ' directive,similar to C ' #ifdef '
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit 9a99912 Oct 11, 2017
Permalink
Failed to load latest commit information.
lib add ifnot feature Oct 10, 2017
.gitignore use regex to get comment Nov 30, 2015
LICENSE Initial commit Nov 30, 2015
README.md readme example Nov 30, 2015
example.js add ifnot feature Oct 10, 2017
index.js init commit Nov 30, 2015
package.json chore: bump to 1.0.2 Apr 10, 2017
webpack.config.js use regex to get comment Nov 30, 2015

README.md

if-loader

This is a preprocesser for the webpack module bundler. It support the ' if ' directive,similar to C ' #ifdef '

Usage

see example.js

//common
var ab = {
  a : 9,
  b : 100
}

/* #if version-b */
(function(){
 "A can't see this"
})()
/* #end */

/* #if version-a */
(function(){
 "B can't see this"
})()
/* #end */

// #if version-b,version-c
(function(){
 "A can't see this"
})()
// #end

// #if version-a,version-c
(function(){
 "B can't see this"
})()
// #end