前端学习案例-vue2源码解析1-数据劫持

安装

npm init -y

安装依赖

 yarn add webpack webpack-cli webpack-dev-server

yarn add html-webpack-plugin 

配置webpack.config.js

const path=require("path"),
// 解析html
HtmlWebpackPlugin=require('html-webpack-plugin')
module.exports={
//模式
mode:"production",
entry:"./src/index.js",
// 打包路径
output:{
filename:"bundle.js",
path:path.resolve(__dirname,"dist")
},
devtool:"source-map",
// 默认寻找位置
resolve:{
modules:[path.resolve(__dirname,""),path.resolve(__dirname,"node_modules")]
},
// 解析html
plugins:[new HtmlWebpackPlugin({
template:path.resolve(__dirname,"public/index.html")
})]
}

posted @   前端导师歌谣  阅读(11)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
点击右上角即可分享
微信分享提示