My webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const webpack = require('webpack');
module.exports = {
mode: 'development',
devtool: 'source-map' ,
context: path.resolve(__dirname, ''),
entry: './src/camera.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
clean:true,
},
devServer: {
static: path.resolve(__dirname, ''),
port: 3000,
open: true,
hot: true,
//compress: true,
historyApiFallback: true
},
plugins:
[
new HtmlWebpackPlugin({
template: './html/camera.html',
}),
new CleanWebpackPlugin(),
],
};