-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.web.config.js
42 lines (40 loc) · 1.51 KB
/
webpack.web.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
/*
********************************************
Copyright © 2021 Agora Lab, Inc., all rights reserved.
AppBuilder and all associated components, source code, APIs, services, and documentation
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
Use without a license or in violation of any license terms and conditions (including use for
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
information visit https://appbuilder.agora.io.
*********************************************
*/
const commons = require('./webpack.commons');
const {merge} = require('webpack-merge');
const path = require('path');
const isDevelopment = process.env.NODE_ENV === 'development';
module.exports = merge(commons, {
// Enable optimizations in production
mode: isDevelopment ? 'development' : 'production',
// Main entry point for the web application
entry: {
main: './index.web.js',
},
output: {
path: path.resolve(__dirname, `../Builds/web`),
},
// Webpack dev server config
devServer: {
port: 9000,
// https: true,
historyApiFallback: true, // Support for react-router
static: './', // same as contentBase from webpack v4 config
client: {
overlay: false,
},
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
},
},
});