1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- const webpack = require("webpack");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- module.exports = {
- entry: "./src/index.js",
- output: {
- filename: "bundle.[hash].js",
- publicPath: "/",
- },
- target: "web",
- resolve: {
- alias: {
- "react-dom": "@hot-loader/react-dom",
- },
- },
- module: {
- rules: [
- {
- test: /\.(js)$/,
- exclude: /node_modules/,
- use: ["babel-loader"],
- },
- {
- test: /\.css$/i,
- use: ["style-loader", "css-loader"],
- },
- {
- test: /\.s[ac]ss$/i,
- use: ["style-loader", "css-loader", "sass-loader"],
- },
- {
- test: /\.(png|svg|jpg|jpeg|gif)$/i,
- type: "asset/resource",
- },
- ],
- },
- plugins: [
- new webpack.HotModuleReplacementPlugin(),
- new HtmlWebpackPlugin({
- template: "public/index.html",
- favicon: "public/favicon.ico",
- }),
- ],
- };
|