style-resources-loader CSS 资源处理器
时间:12-14来源:作者:点击数:
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'build.js'
},
module: {
rules: [
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader', {
loader: 'style-resources-loader',
options: {
patterns: path.resolve(__dirname, 'variables/*.less'),
injector: 'append',
}
}]
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html'
})
]
}