-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
executable file
·46 lines (44 loc) · 974 Bytes
/
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
require('dotenv').config()
const path = require('path');
const webpack = require('webpack');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const { NODE_ENV } = require('./config/main.config');
module.exports = {
entry: './src/index.js',
devtool: 'source-map',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['es2015', 'react', 'stage-3'],
},
},
},
],
},
devServer: {
proxy: {
'*': {
target: 'http://localhost:4000',
},
},
},
plugins: [
new BrowserSyncPlugin({
host: 'localhost',
port: '8080',
proxy: 'http://localhost:4000',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
})
],
};