A webpack loader for px2scalability
npm install px2scalability-loader
module.exports = {
// ...
module: {
rules: [
{
test: /\.(scss|sass)$/,
use: ExtractTextWebpackPlugin.extract({
fallback: 'style-loader',
//如果需要,可以在 sass-loader 之前将 resolve-url-loader 链接进来
use: ['css-loader', 'px2scalability-loader', 'postcss-loader', 'sass-loader']
}),
include: path.join(__dirname, 'src'), //限制范围,提高打包速度
exclude: /node_modules/
}
]
}
}
Please see px2scalability for more information.