Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created April 10, 2024 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/cfb3da40bdef656ba789a1c778e396eb to your computer and use it in GitHub Desktop.
Save velotiotech/cfb3da40bdef656ba789a1c778e396eb to your computer and use it in GitHub Desktop.
// webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\\.(js|jsx)$/,
exclude: /node_modules/,
use: 'babel-loader',
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'public/index.html',
}),
],
devServer: {
static: path.resolve(__dirname, 'public'),
port: 3000,
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment