-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (43 loc) · 1.03 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
require('dotenv').config();
const { resolve } = require('path');
const webpack = require('webpack');
module.exports = {
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./client.jsx',
],
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'dist'),
publicPath: '/',
},
context: resolve(__dirname, 'src'),
devtool: 'inline-source-map',
devServer: {
hot: true,
contentBase: resolve(__dirname, 'dist'),
watchContentBase: true,
publicPath: '/',
},
module: {
rules: [{
test: /\.jsx?$/,
use: ['babel-loader', 'eslint-loader'],
exclude: /node_modules/,
}],
},
resolve: {
extensions: ['.js', '.json', '.jsx'],
},
plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: process.env.NODE_ENV,
KODI_ADDRESS: process.env.KODI_ADDRESS,
KODI_PORT: process.env.KODI_PORT,
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
],
};