-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
40 lines (39 loc) · 1.05 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
const common = require("./webpack.common");
const path = require("path");
const urlapi = require("url");
const frontendUrl = "http://localhost:8080";
const url = urlapi.parse(frontendUrl);
const vendors = Object.keys(require("./package.json").dependencies);
module.exports = {
context: path.join(__dirname, "src"),
entry: {
vendor: vendors,
main: [
"./App/AppStart.js",
"webpack/hot/only-dev-server",
"webpack-dev-server/client?" + url.href
]
},
output: {
publicPath: "/",
path: path.join(__dirname, "AppBuild", "app"),
filename: "assets/[name].js",
chunkFilename: "assets/[id].js"
},
watchOptions: {
aggregateTimeout: 200
},
devServer: {
host: url.hostname,
port: url.port,
hot: true,
historyApiFallback: true,
headers: { 'Access-Control-Allow-Origin': "*" }
},
devtool: "source-map",
module: {
rules: common.rules
},
plugins: common.plugins,
resolve: common.resolve
};