-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
37 lines (35 loc) · 1.13 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
const debug = process.env.NODE_ENV !== 'production'
const webpack = require('webpack')
const precss = require('precss')
const autoprefixer = require('autoprefixer')
const fwp = require('favicons-webpack-plugin')
const hwp = require('html-webpack-plugin')
module.exports = {
context: __dirname,
devtool: debug ? 'inline-sourcemap' : null,
entry: [`${__dirname}/lib/script.js`],
output: {
path: `${__dirname}/dist`,
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.css$/, exclude: ['/node_modules/', '/js/', '/svg/'], loader: 'style-loader!css-loader!postcss-loader!' },
{ test: /\.(png|jpg|svg)$/, loader: 'url-loader?limit=8192' },
{ test: /\.js$/, exclude: ['/node_modules/', '/css/'], loader: 'babel-loader' }
]
},
postcss: function() {
return [precss, autoprefixer]
},
plugins: [
new fwp({
logo: './svg/dolphin.png',
// Inject the html into the html-webpack-plugin
inject: true
}),
new hwp({
template: `${__dirname}/html/index.html`
})
]
}