-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
executable file
·70 lines (66 loc) · 1.42 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
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var BUILD_DIR = path.resolve(__dirname, 'dist/');
var APP_DIR = path.resolve(__dirname, 'src/');
console.info('Building for API_URL: ', process.env.API_URL);
var config = {
entry: ['babel-polyfill', APP_DIR + '/app.js'],
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
module : {
loaders : [
{
test : /\.jsx?/,
include : APP_DIR,
loader : 'babel'
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.(css|scss|sass)$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader')
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=fonts/[name].[ext]'
},
{
test: /\.(jpg|jpeg|png|gif)$/,
loader: 'file?name=images/[name].[ext]'
},
{
test: /\.(index.html)$/,
loader: 'file?name=[name].[ext]'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
node: {
net: "empty",
fs: "empty"
},
plugins: [
new ExtractTextPlugin("styles.css"),
new webpack.ProvidePlugin({
$: "jquery",
jquery: "jquery",
"window.jQuery": "jquery",
jQuery:"jquery",
"window.Tether": 'tether',
tether: 'tether',
Tether: 'tether',
'React': 'react'
}),
new webpack.DefinePlugin({
'process.env.API_URL': JSON.stringify(process.env.API_URL),
}),
]
};
module.exports = config;