-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
63 lines (58 loc) · 1.79 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
const path = require('path');
module.exports = {
mode: "development", // "production" | "development" | "none"
// Chosen mode tells webpack to use its built-in optimizations accordingly.
entry: "./client/app/application.js", // string | object | array
// defaults to ./src
// Here the application starts executing
// and webpack starts bundling
output: {
// options related to how webpack emits results
path: path.resolve(__dirname, "client/js"), // string
// the target directory for all output files
// must be an absolute path (use the Node.js path module)
filename: "main-build.js", // string
// the filename template for entry chunks
publicPath: "/js/", // string
// the url to the output directory resolved relative to the HTML page
},
watch: true,
resolve: {
// options for resolving module requests
// (does not apply to resolving to loaders)
modules: [
"node_modules",
path.resolve(__dirname, "client/app")
],
// directories where to look for modules
extensions: [".js", ".json", ".jsx", ".css"],
// extensions that are used
},
module: {
// configuration regarding modules
rules: [
// rules for modules (configure loaders, parser options, etc.)
{
test: /\.jsx?$/,
},
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: {
minimize: true
}
}
}
]
},
externals: [
'PIXI',
'THREE',
'TweenMax',
'TimelineMax',
/^(jquery|\$)$/i
],
plugins: [
]
}