const path = require('path') const cleanWebpackPlugin = require('clean-webpack-plugin') const copyWebpackPlugin = require('copy-webpack-plugin') const htmlWebpackPlugin = require('html-webpack-plugin') module.exports = { entry: { env: './config/env.js' }, output: { path: path.resolve(__dirname, 'dist'), filename: 'js/[name].js' }, plugins: [ new cleanWebpackPlugin(["dist"]), new htmlWebpackPlugin({ filename: 'index.html', template: './src/index.html', inject: 'head' }), new copyWebpackPlugin([{ from: path.resolve(__dirname, 'src'), to: path.resolve(__dirname, 'dist'), ignore: ["index.html", "js/env.js"] }]) ] }