| 123456789101112131415161718192021222324252627 |
- var path = require('path')
- var webpack = require('webpack')
- const WebpackMerge = require('webpack-merge')
- const baseConfig = require('./webpack.base.js')
- let HtmlWebpackPlugin = require('html-webpack-plugin');
- module.exports = WebpackMerge.merge(baseConfig, {
- mode: 'development',
- entry: path.join(__dirname, 'examples/main.js'), // 入口文件
- output: {
- path: path.join(__dirname, 'dist'), // 打包后文件存放的地方
- filename: 'dist/build.js' // 打包后输出的文件名
- },
- devServer: {
- port: 8086,
- historyApiFallback: true,
- },
- devtool: 'source-map',
- plugins: (module.exports.plugins || []).concat([
-
- new HtmlWebpackPlugin({ // html-webpack-plugin 插件对象
- template: path.join(__dirname, './index.html'), // 指定模板文件
- filename: 'index.html' // 设置内存中的文件名
- })
- ])
- })
|