Answer the question
In order to leave comments, you need to log in
MediaQueryPlugin how to load images used in CSS media queries?
I'm using the media-query-plugin to extract media queries into separate files.
At this stage:
// webpack.common.js
{
test: /\.(sa|sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: paths.images,
},
},
'css-loader',
MediaQueryPlugin.loader,
'postcss-loader',
'sass-loader'
]
},
// webpack.common.js
new MediaQueryPlugin({
include: ['main', 'pages', 'posts', 'admin'],
filename: '../../min/css/[name].[ext]',
queries: {
'screen and (max-width: 1399.98px)': 'max-1400',
'screen and (max-width: 1199.98px)': 'max-1200',
'screen and (max-width: 991.98px)': 'max-992',
'screen and (max-width: 767.98px)': 'max-768',
'screen and (max-width: 575.98px)': 'max-576',
},
}),
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question