默认入口文件
    webpack.config.js

    入口 enter

    1. const config = {
    2. entry: './src/index.js'
    3. };
    4. module.exports = config;

    输出 output

    1. const path = require('path');
    2. const config = {
    3. entry: './src/index.js',
    4. output: {
    5. filename: 'bundle.js',
    6. path: path.join(__dirname, '/dist')
    7. }
    8. }
    9. module.exports = config

    path模块与全局变量

    1. path.join('/目录1', '目录2');
    2. // 返回: '/目录1/目录2
    3. __dirname //能返回当前目录的绝对路径
    4. //webpack的配置中,output.path需要填写绝对路径