-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
76 lines (75 loc) · 2.14 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
var path = require('path'),
webpack = require('webpack');
module.exports = {
entry: {
app: [ './src/index.js' ]
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
},
module: {
noParse: /\.elm$/,
rules: [
{
test: /\.(css|scss)$/,
use: [
'style-loader',
'css-loader',
]
},
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'file-loader?name=[name].[ext]',
},
{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-webpack-loader?verbose=true&warn=true',
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff',
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader',
},
{
test: /\.(jpe?g|png|gif|ico)$/,
loader: 'file-loader?name=./img/[name].[ext]',
},
{
test: /vendor\/.+\.(jsx|js)$/,
loader: 'imports-loader?jQuery=jquery,$=jquery,this=>window'
},
{
test: /bootstrap\/js\//,
loader: 'imports-loader?jQuery=jquery'
},
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery":"jquery"
})
],
resolve: {
// https://stackoverflow.com/questions/31849476/how-to-use-blueimp-file-upload-with-webpack
alias: {
'load-image': 'blueimp-load-image/js/load-image.js',
'load-image-meta': 'blueimp-load-image/js/load-image-meta.js',
'load-image-exif': 'blueimp-load-image/js/load-image-exif.js',
'load-image-scale': 'blueimp-load-image/js/load-image-scale.js',
'canvas-to-blob': 'blueimp-canvas-to-blob/js/canvas-to-blob.js',
'jquery-ui/widget': 'blueimp-file-upload/js/vendor/jquery.ui.widget.js'
}
},
devServer: {
inline: true,
stats: { colors: true },
}
};