-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.config.js
53 lines (51 loc) · 1.28 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
const webpack = require('webpack');
const env = process.env;
const
NODE_ENV = env.NODE_ENV || 'development',
LISTEN_HOST = env.LISTEN_HOST || 'localhost',
LISTEN_PORT = env.LISTEN_PORT || 3030,
GITLAB_URL = env.GITLAB_URL || 'localhost',
GITLAB_TOKEN = env.GITLAB_TOKEN || '';
module.exports = {
entry: './src',
output: {
path: __dirname + '/src',
filename: 'index.js'
},
devtool: NODE_ENV == 'development' ? 'inline-source-map' : false,
devServer: {
inline: true,
host: LISTEN_HOST,
port: LISTEN_PORT,
contentBase: __dirname + '/src'
},
module: {
loaders: [
{
test: /\.css$/,
use: [
{loader: "style-loader"},
{loader: "css-loader"}
]
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
resolve: {
extensions: [
'.webpack.js',
'.jsx',
'.js'
]
},
plugins: [
new webpack.DefinePlugin({
__GITLAB_URL: JSON.stringify(GITLAB_URL),
__GITLAB_TOKEN: JSON.stringify(GITLAB_TOKEN)
})
]
};