This repository was archived by the owner on Sep 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
68 lines (67 loc) · 1.95 KB
/
Copy pathwebpack.config.js
File metadata and controls
68 lines (67 loc) · 1.95 KB
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
var path = require('path'),
webpack = require('webpack');
module.exports = {
entry: {
app: './src/app.jsx'
},
output: {
filename: '[name].bundle.js',
path: __dirname + '/build-front',
publicPath: '/'
},
devServer: {
contentBase: __dirname + '/src',
historyApiFallback: {
index: 'index.html'
}
},
module: {
loaders: [{
// Use babel to transpile react and es2016
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: {
presets: ['react', 'stage-2', 'env'],
plugins: [
'transform-class-properties'
]
}
},
{
test: /\.(scss|css)$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'url-loader?limit=8192&[path][name].[ext]' // inline base64 URLs for <=8k images, direct URLs for the rest
},
// Included a JSON parser for the purpose
// of the InputJson Editor - we should revisit this
// if we end up not using it.
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(ttc|otf)$/,
loader: 'file-loader?name=public/fonts/[name].[ext]'
}
]
},
externals: [{
xmlhttprequest: '{XMLHttpRequest:XMLHttpRequestç}'
}],
plugins: [
new webpack.DefinePlugin({
'process.env': {
ENV: JSON.stringify('dev'),
API_HOST: JSON.stringify('http://localhost:3001/v1')
}
})
],
resolve: {
extensions: ['.js', '.jsx', '.json', '.html']
},
devtool: 'module-source-map'
}