How would I go about querying the mode
within my webpack.config.js
configuration file?
Here's what I want to do. I have the mode
set in my webpack config:
module.exports = {
mode: 'development'
}
When I initialize the mini-css-extract-plugin
I want to check the value of mode
:
plugins: [
new MiniCssExtractPlugin({
filename: (mode === 'development' ? '[name].css' : '[name].[hash].css',
chunkFilename: (mode === 'development' ? '[id].css' : '[id].[hash].css',
})
],
Obviously that doesn't work. How do I query mode
within that plugin initialization?