阅读背景:

一个简单的webpack.config.js配置_zc自由飞~的博客

来源:互联网 
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports={
    entry: './src/index.js',//把src的index.js作为入口进行打包
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist')
    },
    devtool: 'source-map',//可以产生source-map
    resolve: {//更改解析模块的查找方法  找vue文件
        modules: [path.resolve(__dirname,'source'),path.resolve('node_modules')]
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: path.resolve(__dirname, 'public/index.html')
        })
    ]
}
//把src下的index.js打包好插入到public下的index.html文件下
//__dirname指的是当前目录下const path = require('path');
const HtmlWebpack



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: