1234567891011121314151617181920212223242526 |
- const path = require('path')
- const HtmlWebpackPlugin = require('html-webpack-plugin')
- module.exports = {
- mode: 'production', // ['development', 'production']
- entry: path.join(__dirname, 'src', 'index.js'),
- output: {
- filename: 'bundle.[contenthash].js',
- path: path.join(__dirname, 'dist')
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- loader: ['babel-loader'],
- include: path.join(__dirname, 'src'),
- exclude: /node_modules/
- }
- ]
- },
- plugins: [
- new HtmlWebpackPlugin({
- template: path.join(__dirname, 'src', 'index.html'),
- filename: 'index.html'
- })
- ]
- }
|