const path = require('path'); const HtmlWebpackPlugin = require("html-webpack-plugin"); module.exports = { mode: 'production', entry: './src/js/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist'), clean: true, }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, loader: 'eslint-loader', options: { emitError: true, }, }, { test: /\.css$/, use: [ 'style-loader', 'css-loader', ], }, { test: /\.(png|svg|jpg|gif)$/, use: [ 'file-loader', ] }, { test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ 'file-loader', ], }, ], }, plugins: [ new HtmlWebpackPlugin({ hash: true, template: './src/index.html', filename: 'index.html' }) ] };