-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
41 lines (38 loc) · 1.29 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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080',
'webpack/hot/only-dev-server',
// With the following line uncommented, loading the page gives the following errors in the console:
// warning.js:44Warning: Group(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.warning @ warning.js:44
// invariant.js:45Uncaught Invariant Violation: Group(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
//
// If you comment it out, the page loads and displays the React logo
'react-hot-loader/patch',
'./src/index.jsx',
],
module: {
loaders: [{
test: /\.jsx?$/,
include: path.join(__dirname, 'src'),
loader: 'babel-loader',
}]
},
output: {
path: path.join(__dirname, 'build'),
publicPath: '/',
filename: 'index.bundle.js',
},
plugins: [
new HtmlWebpackPlugin({
title: 'React Hot Loader and ReactART Bug',
hash: true,
}),
],
resolve: {
extensions: ['', '.js', '.jsx'],
root: path.join(__dirname, 'node_modules'),
},
};