Webpack标准配置
2024-09-02 13:13:23
let htmlWebpckPlugin= require('html-webpack-plugin');//该组件能将src下面提定的html文件与打包后在js文件打包在一起
module.exports={
mode:'development',
entry:'./src/main.js', //入口文件
output:{
filename:"bundle.js", //出口文件名
path:__dirname+"/dist" //出口文件目录
},
module:{
rules:[
{test:/\.js$/,use:"babel-loader",exclude:/node_modules/},
{test:/\.css$/,use:['style-loader','css-loader']},
{test:/\.less$/,use:'less-loader'},
{test:/\.(jpg|png|gif|jpeg|)$/,use:"url-loader?limit=8192"},
{test:/\.(woff|woff2|eot|ttf|svg)$/,use:'url-loader'},
{test:/\.vue$/,use:"vue-loader"}
]
},
plugins:[
new htmlWebpckPlugin({
template:"./src/index.html",
//filename:"" 设置生成在dist下面的html文件名称
})
],
devServer: { //给webpack-dev-server配置默认的环境
host:"127.0.0.1",
port:8088
},
};
最新文章
- quick sort 的简化实现
- error-2015-9-9
- Linux下的网络远程安装
- css+div绝对定位
- IIS URL Rewrite redirect from one Domain to another
- sql语句中的 inner join 、 left join 、 right join、 full join 的区别
- yii中modules的命名规则
- 求n个数中的最大或最小k个数
- OC9_字符串的内存管理
- PHP中的循环while、do...while、for、foreach四种循环。
- 获取系统的IP
- 框架的设计之IRepository还是IRepository<;T>;
- PE文件格式详解,第一讲,DOS头文件格式
- 如何让模拟的json数据接口能够正常的在手机上有效果
- 近年NOIP考点与主要做法
- vue项目中 如何让外部引入的js模块 的this值 指向vue实例
- 【LeetCode每天一题】Trapping Rain Water(获得雨水的容量)
- 如何在CentOS7上安装Python3及对应问题
- 【redis的链接】redis的两种连接方法
- vue 侧边导航栏递归显示