forked from fbsamples/live-comments-teleprompter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
50 lines (47 loc) · 1.03 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
/**
* Copyright (c) 2018-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const webpack = require('webpack');
if (!process.env.FB_APP_ID) {
console.error('You must set FB_APP_ID in your environment before building. See README.md.');
process.exit(1);
}
module.exports = {
devtool: 'source-map',
entry: {
index: './src/js/index.js',
moderate: './src/js/moderate.js',
teleprompter: './src/js/teleprompter.js'
},
output: {
path: './src/js',
filename: '[name]-bundle.js',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.json$/,
loader: 'json',
},
{
test: /\.css$/,
loader: [ 'style-loader', 'css-loader' ]
}
],
},
plugins: [
new webpack.DefinePlugin({
FB_APP_ID: JSON.stringify(process.env.FB_APP_ID)
})
]
};