-
Notifications
You must be signed in to change notification settings - Fork 22
/
webpack.config.js
88 lines (87 loc) · 2.1 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
78
79
80
81
82
83
84
85
86
87
88
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: [
'script-loader!jquery/dist/jquery.min.js',
'script-loader!bootstrap-sass/assets/javascripts/bootstrap.min.js',
'./app/app.jsx'
],
externals: {
jquery: 'jQuery'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
}),
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery'
}),
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]),
new webpack.optimize.OccurrenceOrderPlugin(true),
new webpack.optimize.UglifyJsPlugin()
],
output: {
path: __dirname,
filename: './public/bundle.js'
},
resolve: {
modules: [
__dirname,
'node_modules',
'./app/components',
'./app/components/metadata-sidebar',
'./app/data',
'libraries'
],
alias: {
applicationStyles: 'app/styles/app.scss',
actions: 'app/actions/actions.jsx',
reducers: 'app/reducers/reducers.jsx',
configureStore: 'app/store/configureStore.jsx'
},
extensions: ['*', '.js', '.jsx'],
symlinks: false
},
module: {
loaders: [
{
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-2']
},
test: /\.jsx?$/,
include: path.resolve(__dirname, "app"),
exclude: /(node_modules|bower_components)/
},
{
loader: 'style-loader!css-loader',
test: /\.css$/
},
{
loader: 'url-loader',
test: /\.(eot|svg|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/
},
{
loader: 'file-loader',
test: /\.png$/
},
{
loader: 'json-loader',
test: /\.json$/
},
{
loader: 'sass-loader', options: {
sourceMap: true,
includePaths: [
path.resolve(__dirname, './node_modules/bootstrap-sass/assets/stylesheets')
]
},
test: /\.scss$/,
}
]
},
devtool: (process.env.NODE_ENV === "production") ? "source-map" : "eval-source-map"
};