const path = require("path");
module.exports = {
//入口
entry:"./src/js/index.js",
output:{
path:path.resolve(__dirname,"build"),
filename:"./js/build.js"
},
mode:'development',
//使用webpack打包的配置文件
module: {
rules: [{
test: /\.less$/i,
use: [{
loader: 'style-loader',
},{
loader: 'css-loader',
},{
loader: 'less-loader',
options: {
lessOptions: {
strictMath: true,
},
},
},
],
},{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
name: './img/[hash:10].[ext]'
},
},
],
},
],
},
}