默认入口文件
webpack.config.js
入口 enter
const config = {entry: './src/index.js'};module.exports = config;
输出 output
const path = require('path');const config = {entry: './src/index.js',output: {filename: 'bundle.js',path: path.join(__dirname, '/dist')}}module.exports = config
path模块与全局变量
path.join('/目录1', '目录2');// 返回: '/目录1/目录2__dirname //能返回当前目录的绝对路径//webpack的配置中,output.path需要填写绝对路径
