webpack-conditional-loader
webpack-conditional-loader copied to clipboard
is it compatible with webpack 4
Hello,
This is my first attempt to use this loader but I can't make it work. I do have NODE_ENV set but still not working
console.log("process.env.NODE_ENV", process.env.NODE_ENV); // -> development
// #endif
// #if process.env.NODE_ENV === 'production'
console.log("production Application started"); // is printed to console
// #endif
// #if ENV === 'development'
console.log("development Application started"); // is printed to console
// #endif
Both log are printed to console
I have the same issue, but this is not due to webpack. If you are on Windows, see PR #6
@no-more @bbert @caiogondim have same problem
after update the project to last version ( "@babel/core": "7.9.0"
, "babel-loader": "8.1.0"
, "webpack": "4.42.0"
)
i tried to using webpack-conditional-loader
again but it didn't work
i made some change in the source code and the problem solved. but when i used this for dynamic import . this error occurred before get the source code in loader . get the syntax error of duplicate import like this :
but i test the codes with console.log()
and every thing work well
do you have any idea , why this happen ?