-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
68 lines (68 loc) · 1.99 KB
/
webpack.common.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
68
// webpack.common.js
const path = require("path");
module.exports = {
entry: {
index: "./src/Index.jsx",
},
output: {
// `filename` provides a template for naming your bundles (remember to use `[name]`)
filename: "[name].bundle.js",
// `chunkFilename` provides a template for naming code-split bundles (optional)
chunkFilename: "[name].bundle.js",
// `path` is the folder where Webpack will place your bundles
path: __dirname + "/public/bundles",
// `publicPath` is where Webpack will load your bundles from (optional)
publicPath: "bundles/",
},
optimization: {
splitChunks: {
// chunks: "async", // all, async, and initial
chunks: "all", // all, async, and initial
},
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
}
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.bundle\.js$/,
use: "bundle-loader",
},
],
},
// modules: [path.resolve(__dirname, "app"), "node_modules"],
resolve: {
alias: {
libs: path.resolve(__dirname, "src/libs/"),
// components: path.resolve(__dirname, "src/components/"),
actions: path.resolve(__dirname, "src/actions/"),
sockets: path.resolve(__dirname, "src/sockets/"),
sagas: path.resolve(__dirname, "src/sagas/"),
reducers: path.resolve(__dirname, "src/reducers/"),
constants: path.resolve(__dirname, "src/constants/"),
features: path.resolve(__dirname, "src/features/"),
// src: path.resolve(__dirname, "src/"),
components: path.resolve(__dirname, "src/components/"),
src: path.resolve(__dirname, "src/main/"),
main: path.resolve(__dirname, "src/main/"),
party: path.resolve(__dirname, "src/party/"),
dj: path.resolve(__dirname, "src/dj/"),
email: path.resolve(__dirname, "src/email/"),
shared: path.resolve(__dirname, "../shared"),
live: path.resolve(__dirname, "src/live/"),
},
},
node: {
fs: "empty",
},
};