-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
51 lines (49 loc) · 1.16 KB
/
webpack.config.js
File metadata and controls
51 lines (49 loc) · 1.16 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
'use strict';
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
module.exports = {
entry: {
main: './src/index.js',
polyfills: './src/polyfills.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
},
devtool: 'source-map',
plugins: [
new UglifyJSPlugin({
sourceMap: true
}),
new WebpackNotifierPlugin({
title: 'Pattern Library Website',
alwaysNotify: true
})
],
module: {
rules: [{
test: /\.jsx?$/,
exclude: ['node_modules','app/assets/bower','app/bundle.js'],
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}, {
test: /\.html$/,
loaders: ['babel-loader?presets[]=es2015', 'wc-loader?minify=true']
}, {
test: /\.(png|jpg|gif|svg)$/, // handles assets. eg <img src="path.png">
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}]
}]
},
resolve: {
mainFields: ['browserify', 'browser', 'module', 'main']
}
};