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 { /*#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;}
<!--#if dev||stage-->DEVELOPMENT VERSION<!--#endif-->
webpack.config:
module: loaders: test: /\.$/ loader: "webpack-preprocessor?definitions=['stage,test']" ;