-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
62 lines (60 loc) · 1.36 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
// const OpenBrowserPlugin = require('open-browser-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const dotenv = require('dotenv');
dotenv.config();
module.exports = {
entry: ['babel-polyfill', `${path.resolve(__dirname, 'src')}/index.js`],
module: {
loaders: [
{
test: /\.(ttf|eot|svg|jpg|png)$/,
include: path.resolve(__dirname, 'src'),
use: [{
loader: 'file-loader',
}],
},
{
loaders: ['style-loader', 'css-loader'],
test: /\.(css|png)$/,
},
{
exclude: /node_modules/,
include: path.join(__dirname, 'src'),
loader: 'babel-loader',
query: {
presets: ['react', 'es2015'],
},
test: /\.jsx?$/,
},
],
},
devtool: 'source-map',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'public'),
},
resolve: {
extensions: ['.webpack.js', '.js', '.jsx'],
alias: {
src: path.resolve(__dirname, 'src'),
},
},
node: {
fs: 'empty',
},
devServer: {
contentBase: path.join(__dirname, 'public'),
compress: true,
port: 3000,
proxy: {
'/api': 'http://localhost:8000',
'/auth': 'http://localhost:8000',
},
},
plugins: [
new webpack.EnvironmentPlugin([
'GoogleCloudTranslationApiKey',
]),
],
};