forked from miccomservices/CoinSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
58 lines (56 loc) · 1.14 KB
/
webpack.dev.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
const Dotenv = require('dotenv-webpack');
const webpack = require('webpack');
const merge = require('webpack-merge');
const autoprefixer = require('autoprefixer');
const common = require('./webpack.common.js');
const dotEnv = new Dotenv({
path: '.env.loc',
safe: true
});
module.exports = merge(common, {
output: {
publicPath: '/'
},
devServer: {
contentBase: false,
hot: true,
port: 8000,
proxy: {
'/api': {
target: 'http://localhost:' + JSON.parse(dotEnv.definitions['process.env.PORT']),
pathRewrite: {'^/api' : ''}
}
}
},
module: {
rules: [
{
test: /\.(sass|scss)$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader'
},
{
loader: 'postcss-loader',
options: {
plugins: [
autoprefixer
]
}
},
{
loader: 'sass-loader'
}
]
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
dotEnv
]
});