-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathwebpack.config.js
More file actions
52 lines (49 loc) · 1.29 KB
/
webpack.config.js
File metadata and controls
52 lines (49 loc) · 1.29 KB
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
// We are using node's native package 'path'
// https://nodejs.org/api/path.html
const path = require('path');
var webpack = require('webpack');
// Constant with our paths
const paths = {
DIST: path.join(__dirname, '/client/dist'),
SRC: path.join(__dirname, '/client/src'),
};
// Webpack configuration
module.exports = {
entry: path.join(paths.SRC, 'app.jsx'),
output: {
path: paths.DIST,
filename: 'bundle.js'
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
module : {
loaders : [
{
test : /\.jsx?/,
include : paths.SRC,
loader : 'babel-loader',
query: {
presets: ['react', 'es2015']
}
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 8192
}
}
]
},
{test: /\.less$/,loader: 'style-loader!css-loader?importLoaders=2&sourceMap&localIdentName=[local]__[hash:base64:5]!less-loader'},
{ test: /\.css/, loader: 'style-loader!css-loader?importLoaders=2&sourceMap&localIdentName=[local]__[hash:base64:5]' },
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }
]
}
};