-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
120 lines (118 loc) · 2.63 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* eslint strict: 0 */
'use strict'
var webpack = require('webpack')
var path = require('path')
var CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
cache: true,
devtool: 'source-map',
devServer: {
contentBase: 'build/client',
historyApiFallback: true,
hot: true,
inline: true,
stats: 'errors-only',
},
entry: [
'react-hot-loader/patch',
'./client/index.js'
],
output: {
path: path.resolve(__dirname, 'build', 'client'),
publicPath: '/',
filename: 'app.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js(x)?$/,
loader: 'eslint-loader'
},
{
test: /\.js(x)?$/,
exclude: /(node_modules)/,
loader: 'babel-loader'
},
{
test: /\.woff($|\?)|\.woff2($|\?)|\.ttf($|\?)|\.eot($|\?)|\.svg($|\?)/,
loader: 'url-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(s)?css$/,
exclude: /node_modules/,
use: [
{
loader: 'style-loader'
}, {
loader: 'css-loader',
options: {
camelCase: true,
importLoaders: 1,
localIdentName: '[path][name]__[local]--[hash:base64:5]',
modules: true,
sourceMap: true
}
}, {
loader: 'sass-loader',
options: { sourceMap: true }
}
]
},
{
test: /\.(s)?css$/,
include: /node_modules/,
use: [
{
loader: 'style-loader'
}, {
loader: 'css-loader',
}, {
loader: 'sass-loader',
options: { sourceMap: true }
}
]
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=8192'
},
{
test: /\.sol/,
loaders: ['json-loader', 'truffle-solidity-loader?network=development']
}
],
noParse: /lie\.js|[\s\S]*.(svg|ttf|eot)/
},
node: {
fs: 'empty',
net: 'empty',
tls: 'empty'
},
plugins: [
// Copy our app's index.html to the build folder.
new CopyWebpackPlugin([
{ from: './client/index.html', to: 'index.html' }
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'__DEV__': true,
'process.env': {
API_ENDPOINT: JSON.stringify('//localhost:8000'),
NODE_ENV: JSON.stringify('development'),
IPFS_HOST: JSON.stringify('testrpc'),
IPFS_PORT: 5001
}
})
],
stats: {
children: false
}
}