0.1.12 • Published 6 years ago

webpack-preprocessor v0.1.12

Weekly downloads
615
License
MIT
Repository
github
Last release
6 years ago

Webpack Preprocessor

Webpack plugin for preprocessor support

This project is my first attempt at making a webpack loader and is based on the webpack-strip-block project by jballant webpack-strip-block

###Example:

funcion foo() {
    /*#if dev*/
    let bar = 'dev';
    /*#elif stage&&test*/
    let bar = 'stage-test';
    /*#elif stage||test*/
    let bar = 'stage-or-test';
    /*#else*/
    let bar = 'prod';
    /*#endif*/

    /*#if !dev*/
    bar += '!dev';
    /*#endif*/
    
    /*#if cond1&&cond2||cond3 */ // <-- combinations of && and || operators are not supported
    /*#endif*/

    console.log(bar);
}
<!--#if dev||stage-->
<div>DEVELOPMENT VERSION</div>
<!--#endif-->

webpack.config:

{
    module: {
        loaders: [
            { test: /\.(js|htm(l?))$/, loader: "webpack-preprocessor?definitions=['stage,test']" }
        ]
    }
};
0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago