forked from renganatha10/whatsapp-PWA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
61 lines (59 loc) · 1.36 KB
/
webpack.dev.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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ServiceWorkerPlugin = require('serviceworker-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
entry: [
'./app'
],
output: {
path: path.join(__dirname, 'static'),
filename: 'bundle.js',
publicPath: '/'
},
plugins: [
new HtmlWebpackPlugin({
title: 'WhatsApp Clone',
template: './index.html',
}),
new webpack.HotModuleReplacementPlugin(),
new ServiceWorkerPlugin({
entry: path.join(__dirname, './app/sw.js')
})
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015', 'stage-0']
}
},
{
test: /\.scss$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!sass-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
loader: 'file-loader',
},
{
test: /\.(jpg|png|gif)$/,
include: /images/,
loader: 'url-loader'
},
{
test: /manifest.json$/,
loader: 'file-loader?name=manifest.json'
}
]
}
};