This repository has been archived by the owner on Mar 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
webpack.config.js
63 lines (62 loc) · 1.97 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
var WebPack = require('webpack');
var HtmlPlugin = require('html-webpack-plugin');
var HasteResolver = require('haste-resolver-webpack-plugin');
module.exports = {
output: {
filename: 'bundle.js',
path: __dirname + '/dist',
publicPath: '/'
},
cache: true,
debug: true,
devtool: 'source-map',
entry: {
app: __dirname + '/index.web.js'
},
plugins: [
new HasteResolver({
platform: 'web'
}),
new HtmlPlugin({
filename: 'index.html',
template: __dirname + '/index-template.html'
})
],
module: {
loaders: [
// Load CSS files that are required in modules.
{
test: /\.css$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader',
},
// Load font files for font-awesome. It uses a trailing version
// number in the names when requiring so we have to accept them in
// our test regex.
{
test: /\.(eot|svg|ttf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader"
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=10000&minetype=application/font-woff"
},
// Process all JavaScript files as ECMAScript2015 along with
// accepting the JSX syntax used by React.
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react', 'stage-1']
}
},
// Disable AMD for Strophe and its plugins because we don't know how
// to require them successfully.
{
test: /\/strophe(js-plugins)?\//,
loader: 'imports?define=>false&this=>window'
}
]
}
};