-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
77 lines (72 loc) · 1.87 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// External libs
var webpack = require('webpack');
var path = require('path');
// Put React as a global variable
var providePlugin = new webpack.ProvidePlugin({
'React': 'react',
'Immutable': 'immutable',
$: 'jquery',
'window.$': 'jquery',
'window.jQuery': 'jquery',
'jQuery': 'jquery',
'_': 'underscore',
UI: '!json-loader!' + path.resolve(__dirname, './client/style/ui-kit.json'),
'es6-promise': 'es6-promise',
fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',
});
var definePlugin = new webpack.DefinePlugin({
'process.env.FIREBASE_API_KEY': JSON.stringify(process.env.FIREBASE_API_KEY),
'process.env.FIREBASE_AUTH_DOMAIN': JSON.stringify(process.env.FIREBASE_AUTH_DOMAIN),
'process.env.FIREBASE_DATABASE_URL': JSON.stringify(process.env.FIREBASE_DATABASE_URL),
});
var config = {
entry: ['./client/app.jsx'],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
devtool: 'source-map',
module: {
loaders: [
{
id: 'jsx',
test:/\.(js|jsx)?$/,
loaders: ['babel?presets[]=react,presets[]=es2015,plugins[]=add-module-exports', 'eslint-loader'],
exclude: /(node_modules)/,
},
{
id: 'img',
test: /\.(png|jpg|svg)?$/,
loader: 'file-loader',
exclude: /node_modules/
},
{
id: 'font',
test: /\.(otf|eot|woff|ttf)$/,
loader: 'file-loader',
exclude: /node_modules/
},
{
id: 'style',
test: /\.(styl|css)$/,
loader: 'style-loader!css-loader!stylus-loader',
exclude: /(node_modules)/
},
]
},
plugins: [
providePlugin,
definePlugin,
],
resolve: {
modulesDirectories: [
'node_modules/',
'utils/',
'components/',
'./client/actions',
'./client/store',
'./client/globals'
],
},
};
module.exports = config;