-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
67 lines (66 loc) · 1.67 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: path.resolve(__dirname, "react-app", "index.js"),
output: {
path: path.resolve(__dirname, "filesmanager", "static", "html"),
filename: "bundle.js",
libraryTarget: "window"
},
module: {
rules: [
{
test: /\.(js|ts)x?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
},
},
{
test: /\.(png|jpe?g|gif|svg)$/i,
use: 'file-loader',
},
{
test: /\.(css|scss)$/,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
},
{
test: /\.html$/,
use: {
loader: "html-loader"
},
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "react-app", "index.html"),
}),
],
resolve: {
modules: [path.resolve(__dirname, "react-app"), "node_modules"],
extensions: [".js", ".jsx", ".tsx", ".ts"],
alias: {
chonky: "chonky/dist",
'@components': path.resolve(__dirname, 'react-app/components'),
'@constants': path.resolve(__dirname, 'react-app/constants'),
"@config": path.resolve(__dirname, 'react-app/config'),
"@services": path.resolve(__dirname, 'react-app/services'),
"@hooks": path.resolve(__dirname, 'react-app/hooks')
}
},
devServer: {
static: {
directory: path.join(__dirname, 'react-app', 'public'),
},
port: 3000,
hot: true,
}
};