forked from hrla14-elfuego/bartr
/
webpack.config.dev.js
78 lines (75 loc) · 1.81 KB
/
webpack.config.dev.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const webpack = require('webpack');
const path = require('path');
require('dotenv').config()
const SRC_DIR = path.resolve(__dirname, './client/src/');
const BUILD_DIR = path.resolve(__dirname, './client/build/');
module.exports = {
// entry: path.resolve(SRC_DIR, 'index.js'),
entry: {
'app': [
'react-hot-loader/patch',
"webpack-dev-server/client?http://localhost:8080",
'webpack/hot/dev-server',
"babel-polyfill",
'./client/src/index'
]
},
output: {
filename: 'bundle.js',
path: BUILD_DIR
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader?cacheDirectory',
exclude: /node_modules/,
query: {
cacheDirectory: true,
presets: ['es2015', 'react'],
plugins: [
'transform-object-rest-spread',
'transform-regenerator',
'react-hot-loader/babel',
]
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.json$/,
loader: 'json-loader'
}
],
},
resolve: {
/*extensions: ['.webpack.js', '.web.js', '.js']*/
},
node: {
console: true,
fs: 'empty',
net: 'empty',
tls: 'empty'
},
// target: 'node',
// devServer: {
// contentBase: "./client/static",
// publicPath: "/",
// hot: true,
// inline: true
// },
devtool: 'inline-source-map',
cache: true,
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'DEPLOYMENT_ENV': JSON.stringify(process.env.NODE_ENV),
'API_ENDPOINT': JSON.stringify(process.env.API_ENDPOINT),
'AUTH0_CLIENT_ID': JSON.stringify(process.env.AUTH0_CLIENT_ID),
'AUTH0_DOMAIN': JSON.stringify(process.env.AUTH0_DOMAIN),
'PEERS_API_KEY': JSON.stringify(process.env.PEERS_API_KEY)
})
]
};