bootstrap-loader icon indicating copy to clipboard operation
bootstrap-loader copied to clipboard

Weired behaviour of getEnvProps - Could not find 'styleLoaders' in your config

Open yahyaensi opened this issue 6 years ago • 1 comments

I use the version 2.1.0 of bootstrap-loader but i tried also 3.0.4.

bootstrap-loader doesn't find styleLoaders in .bootsraprc.

I tried to debug bootstrap-loader's getEnvProps method by adding console.log to it like following:

exports.default = function (prop, config) { if (prop in config) { return config[prop]; } var NODE_ENV = process.env.NODE_ENV; var configEnvSection = config.env && config.env[NODE_ENV]; console.log(NODE_ENV); console.log(config.env); console.log(config.env[NODE_ENV]); if (configEnvSection && prop in configEnvSection) { return configEnvSection[prop]; } return false; };

Then i get the following output:

development { development: { loglevel: 'debug', styleLoaders: [ 'style-loader?sourceMap', 'css-loader?sourceMap&importLoaders=2', 'sass-loader?sourceMap&outputStyle=expanded' ], extractStyles: false }, production: { styleLoaders: [ 'css-loader?importLoaders=1', 'sass-loader?sourceMap' ], extractStyles: true } } undefined

This instruction config.env[NODE_ENV] returns undefined.

yahyaensi avatar Jan 26 '20 19:01 yahyaensi

See #359.

justin808 avatar Feb 20 '20 23:02 justin808

I close this issue. Please comment if it is still relevant.

ahangarha avatar Jan 05 '23 09:01 ahangarha