123456789101112131415161718192021222324252627282930 |
- const path = require('path')
- const HtmlWebpackPlugin = require('html-webpack-plugin')
- module.exports = {
- mode: 'development', // ['development', 'production']
- entry: path.join(__dirname, 'src', 'index.js'),
- output: {
- filename: 'bundle.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'
- })
- ],
- devServer: {
- port: 3001,
- contentBase: path.join(__dirname, 'dist')
- }
- }
|