forked from webex/webex-js-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
62 lines (60 loc) · 1.93 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
const dotenv = require('dotenv');
const glob = require('glob');
const path = require('path');
const {EnvironmentPlugin} = require('webpack');
dotenv.config();
dotenv.config({path: '.env.default'});
module.exports = {
entry: './packages/node_modules/ciscospark',
output: {
filename: 'bundle.js',
library: 'ciscospark',
libraryTarget: 'var',
path: __dirname,
sourceMapFilename: '[file].map'
},
devtool: 'source-map',
devServer: {
https: true,
disableHostCheck: true,
port: 8000
},
resolve: {
alias: glob
.sync('**/package.json', {cwd: './packages/node_modules'})
.map((p) => path.dirname(p))
.reduce((alias, packageName) => {
// Always use src as the entry point for local files so that we have the
// best opportunity for treeshaking; also makes developing easier since
// we don't need to manually rebuild after changing code.
alias[`./packages/node_modules/${packageName}`] = path.resolve(__dirname, `./packages/node_modules/${packageName}/src/index.js`);
alias[`${packageName}`] = path.resolve(__dirname, `./packages/node_modules/${packageName}/src/index.js`);
return alias;
}, {})
},
module: {
rules: [
{
test: /\.js$/,
include: /packages\/node_modules/,
use: {
loader: 'babel-loader'
}
}
]
},
plugins: [
new EnvironmentPlugin({
CISCOSPARK_LOG_LEVEL: 'log',
DEBUG: '',
NODE_ENV: process.env.NODE_ENV || 'development',
// The follow environment variables are specific to our continuous
// integration process and should not be used in general
// Also, yes, CONVERSATION_SERVICE does not end in URL
CONVERSATION_SERVICE: process.env.CONVERSATION_SERVICE,
WDM_SERVICE_URL: process.env.WDM_SERVICE_URL,
HYDRA_SERVICE_URL: process.env.HYDRA_SERVICE_URL,
ATLAS_SERVICE_UR: process.env.ATLAS_SERVICE_URLL
})
]
};