-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.dev.js
54 lines (53 loc) · 1.42 KB
/
webpack.dev.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
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'development',
devtool: 'inline-source-map',
entry: {
main: './app/js/src/index.js',
slides: './app/js/slides/index.js',
},
devServer: {
contentBase: './dist',
host: '0.0.0.0',
disableHostCheck: true
},
output: {
filename: 'src/[name].bundle.js',
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'app/images', to: 'images' },
{ from: 'app/js/lib', to: 'src/lib' },
{ from: 'app/*.html', to: '[name].html' },
{ from: 'app/manifest.json', to: 'manifest.json' },
]}),
],
module: {
rules: [{
test : /\.(png|jpg|svg|gif|ttf|woff|eot)$/,
use: [
{
loader: 'url-loader',
options: {
limit: false // <-- Do not convert images to Base64 or they will need to be decypted on every frame!!
}
}
]
},
{
test: /\.(css|scss)$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'sass-loader'
}]
}]
},
performance: {
hints: 'warning'
},
};