Skip to content

Commit

Permalink
Create webpack.config.js_off
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-police committed Aug 18, 2024
1 parent edecf1e commit 9910a22
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');

// The source of react stuff
var DIR_React_Project_src = "src"

module.exports = {
entry: path.join(__dirname, `./${DIR_React_Project_src}/index.js`),

output: {
path: path.join(__dirname, "/dist"),
filename: "bundle.js",
},

resolve: {
modules: ['node_modules'],
alias: {
react: path.join(__dirname, 'node_modules', 'react'),
},
extensions: [
'.ts', '.tsx', '.js', '.jsx', '.json', '.cjs', '.mjs'
],
},

module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
],
},
],
},

plugins: [
new HtmlWebPackPlugin({
template: path.join(__dirname, `./public/index.html`)
})
]
}

0 comments on commit 9910a22

Please sign in to comment.