forked from freeCodeCamp/pantry-for-good
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
65 lines (64 loc) · 2 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
const webpack = require('webpack')
const {resolve} = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: {
vendor: ['react-hot-loader/patch',
'admin-lte', 'bootstrap', 'history', 'lodash', 'moment', 'moment-recur',
'redux', 'redux-thunk', 'normalizr', 'whatwg-fetch', 'react', 'prop-types',
'react-dom', 'react-redux', 'react-router-dom', 'react-router-redux',
'react-hot-loader', 'react-bootstrap', 'react-bootstrap-autosuggest',
'react-bootstrap-table', 'jquery', 'redux-form', 'reselect', 'recompose',
'react-dnd', 'react-dnd-html5-backend', 'react-quill', 'react-google-maps',
'quill-image-drop-module', 'quill-image-resize-module', '@mapbox/polyline'
]
},
module: {
rules: [
{
test: /\.js$/,
include: [
resolve(__dirname, 'client'),
resolve(__dirname, 'common'),
resolve(__dirname, 'node_modules', 'quill-image-drop-module'),
resolve(__dirname, 'node_modules', 'quill-image-resize-module')
],
loader: 'babel-loader',
query: {
presets: [['es2015', {modules: false}], 'stage-0', 'react'],
plugins: ['react-hot-loader/babel']
}
}, {
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: ['url-loader?limit=10000&name=fonts/[name]-[hash].[ext]']
}, {
test: /\.(jpe?g|png|gif)$/i,
use: ['file-loader?hash=sha512&digest=hex&name=media/[name]-[hash].[ext]']
}
]
},
resolve: {
alias: {
store: resolve(__dirname, 'client', 'store'),
}
},
node: {
fs: "empty"
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'window.Quill': 'quill'
}),
new HtmlWebpackPlugin({
template: resolve(__dirname, 'client', 'index.html'),
inject: 'body'
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.js'
})
]
}