1.首先先引入一个path依赖,这是用来写路径用的
const path = require(‘path‘)
2.再写一个module文件
module.exports={ entry:‘./public/index.js‘, //文件的入口路径 output:‘}
entry是入口文件
使用配置文件webpack.config.js打包文件
原文:https://www.cnblogs.com/lanlanJser/p/11879259.html