-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
50 lines (48 loc) · 1.22 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
'use strict'
const LiveReloadPlugin = require('webpack-livereload-plugin')
const isDev = process.env.NODE_ENV === 'development'
const path = require('path')
module.exports = {
entry: {
'app': './client/index.jsx',
'popup': './client/popup.jsx'
},
output: {
path: path.join(__dirname,'./chrome/js'),
filename: '[name].bundle.js'
},
devtool: 'eval',
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader'
},
{
test: /\.(scss|css|less)$/,
use: [
'style-loader',
'css-loader',
'sass-loader',
'less-loader'
]
},
{
test: /\.(svg|png|ttf?|woff|woff2|eof|eot)$/,
loader: 'file-loader'
}
]
},
resolve: {
modules: [
path.resolve('client'),
'node_modules'
],
extensions: [ '.js', '.jsx', '.css', '.scss', '.png', '*' ]
},
// When we're in development, we can use this handy live-reload plugin
// to refresh the page for us every time we make a change to our client-side
// files. It's like `nodemon` for the front end!
plugins: isDev ? [new LiveReloadPlugin({appendScriptTag: true})] : []
}