-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edecf1e
commit 9910a22
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`) | ||
}) | ||
] | ||
} |