nippur72 / ifdef-loader

Webpack loader for JavaScript/TypeScript conditional compilation.
286 stars 28 forks source link

using with react-app-rewired #29

Open ajayep opened 5 years ago

ajayep commented 5 years ago

Hi,

I am trying out ifdef-loader with react-app-rewired.

Below are the contents of my config-overrides.js file `

module.exports = function override(config, env) { console.log('override!');

const opts = {
    PRODUCTION:false,
    DEBUG: true,
    "ifdef-verbose": true
 };

let loaders = config.module.rules[2].oneOf;

loaders.splice(loaders.length - 1, 0, {
    test: /\.js$/,
    use: [
        { loader: "echo-loader?msg=dump" },  
        { loader: "ifdef-loader", options: opts } 
     ]
});

return config;

};`

When I dump the files being processed by echo-loader I see my files are not getting processed

dump.txt

Any clues on how I can get it working with react-app-rewired ?

Cheers Ajay

nippur72 commented 5 years ago

in dump.txt I don't see any // #ifdef directives that have to be processed with ifdef-loader