forked from crowdedProject/Crowded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
40 lines (37 loc) · 918 Bytes
/
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
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')
}
]
}
}
module.exports = config;