-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
86 lines (81 loc) · 1.99 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const webpack = require('webpack');
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ROOT = path.resolve(__dirname);
const APP = __dirname + '/app';
const config = {
context: APP,
entry: {
app: './index.js'
},
output: {
path: path.join(ROOT, 'dist'),
publicPath: '/',
filename: 'presentation.bundle.js'
},
module: {
rules: [
{
test: require.resolve('reveal.js'),
use: {
loader: 'expose-loader',
options: 'Reveal'
}
},
{
test: /\.eot(\?\S*)?$/,
use: 'url-loader?limit=100000&mimetype=application/vnd.ms-fontobject'
},
{
test: /\.woff2(\?\S*)?$/,
use: 'url-loader?limit=100000&mimetype=application/font-woff2'
},
{
test: /\.woff(\?\S*)?$/,
use: 'url-loader?limit=100000&mimetype=application/font-woff'
},
{
test: /\.ttf(\?\S*)?$/,
use: 'url-loader?limit=100000&mimetype=application/font-ttf'
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: 'file-loader'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: 'svg-url-loader?limit=10000&mimetype=image/svg+xml'
},
{
test: /\.(png|jpg|jpeg|gif)$/i,
use: 'url-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /index\.html/,
use: ['html-loader', 'file-loader?name=[name].[ext]']
}
]
},
plugins: [
new CleanWebpackPlugin({}),
new webpack.optimize.OccurrenceOrderPlugin(),
// use for development time hot-swap of only modified modules that the webpack client will load up
new webpack.HotModuleReplacementPlugin(),
new CopyWebpackPlugin({
patterns: [{
from: 'images',
to: 'images'
}
]
})
],
devServer: {
contentBase: APP
}
};
module.exports = config;