-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
47 lines (44 loc) · 1.12 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
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const BUILD_DIR = path.resolve(__dirname, 'dist');
const APP_DIR = path.resolve(__dirname, 'src/client');
const config = {
entry: `${APP_DIR}/index.js`,
output: {
path: BUILD_DIR,
publicPath: '/',
filename: 'bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
title: 'CrowdedCafe',
template: 'src/client/index.html',
filename: 'index.html'
}),
new ExtractTextPlugin('style.css')
],
module: {
loaders: [
{
test : /\.js?/,
include : APP_DIR,
loader : 'babel'
},
{
test: /\.css$/,
include: APP_DIR,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
}
]
}
}
module.exports = config;