-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (42 loc) · 948 Bytes
/
webpack.config.js
File metadata and controls
42 lines (42 loc) · 948 Bytes
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
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src/js', 'App.js'),
devServer: {
contentBase: path.join(__dirname, 'src'),
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'build.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader','css-loader'],
include: [/src/, /node_modules/]
}, {
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react', 'stage-2']
}
}, {
test: /\.json$/,
loader: 'json-loader',
include: '/build/contracts/'
},
{
test: /\.(jpg|png|gif|svg|pdf|ico)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[path][name]-[hash:8].[ext]'
},
},
]
},
]
}
}