-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
53 lines (51 loc) · 1.2 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
require('webpack');
const WebpackBar = require('webpackbar');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const processHTMLPages = require('./processHTMLHelper.js');
const extractCSS = new ExtractTextPlugin('style.css');
const ProgressBar = new WebpackBar();
const plugins = [
ProgressBar,
extractCSS,
].concat(processHTMLPages());
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'./source/index.js'
],
module: {
rules: [
{
test: [/\.scss$/i, /\.sass$/i, /\.css$/],
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'sass-loader']
})
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader',
query: {
name: '[path][name].[ext]',
context: './source'
}
},
],
},
resolve: {
extensions: ['.js', '.es6'],
},
output: {
path: __dirname + '/build',
filename: 'index.js',
},
devServer: {
contentBase: './source'
},
plugins,
};