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]'
                    },
                },
                ],
            },
        ],
    },
}
posted on 2021-06-18 10:56  文种玉  阅读(38)  评论(0编辑  收藏  举报