-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.shared.js
73 lines (72 loc) · 1.75 KB
/
webpack.config.shared.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
69
70
71
72
73
const path = require("path");
const webpack = require("webpack");
module.exports = {
config: {
entry: {
root: "./static/js/entry/root",
header: "./static/js/entry/header",
style: "./static/js/entry/style",
django: "./static/js/entry/django",
},
module: {
rules: [
{
test: /\.(png|jpg|svg|ttf|woff|woff2|eot|gif)$/,
type: "asset/inline",
},
{
test: require.resolve("jquery"),
use: [
{
loader: "expose-loader",
options: {
exposes: ["jQuery", "$"],
},
},
],
},
{
test: require.resolve("hls.js"),
use: [
{
loader: "expose-loader",
options: {
exposes: "Hls",
},
},
],
},
],
},
resolve: {
modules: [path.join(__dirname, "static/js"), "node_modules"],
extensions: [".js", ".jsx"],
},
performance: {
hints: false,
},
},
babelSharedLoader: {
test: /\.jsx?$/,
include: [
path.resolve(__dirname, "static/js"),
path.resolve(__dirname, "node_modules/query-string"),
path.resolve(__dirname, "node_modules/strict-uri-encode"),
],
loader: "babel-loader",
options: {
presets: [
["@babel/preset-env", { modules: false }],
"@babel/preset-react",
"@babel/preset-flow",
],
plugins: [
"@babel/plugin-transform-flow-strip-types",
"react-hot-loader/babel",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import",
],
},
},
};