-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
60 lines (59 loc) · 1.42 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
const path = require('path');
module.exports = {
entry: [
path.resolve(__dirname, 'client/js/Index.jsx'),
path.resolve(__dirname, 'client/assets/css/style.scss')
],
output: {
path: '/',
filename: 'bundle.js',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.scss$/,
loader: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.jsx?$/,
loader: 'babel-loader',
include: path.resolve(__dirname, './client/'),
exclude: path.resolve(__dirname, 'node_modules/'),
query: { presets: ['es2015', 'react', 'stage-2']
}
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file-loader?hash=sha512&digest=hex&name=[hash].[ext]', {
loader: 'image-webpack-loader',
query: {
mozjpeg: {
progressive: true,
},
gifsicle: {
interlaced: false,
},
optipng: {
optimizationLevel: 7,
},
pngquant: {
quality: '75-90',
speed: 3,
},
},
}],
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.js', '.json', '.jsx', '.css', '.scss']
},
watch: true
};