-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
58 lines (56 loc) · 1.22 KB
/
webpack.dev.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
/*
alias npm-exec='PATH=$(npm bin):$PATH'
*/
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: path.join(__dirname, "src"),
devtool: "#eval-sourcemap",
entry: "./main.js",
devServer: {
historyApiFallback: true,
hot: true,
inline: true,
host: 'localhost', // Defaults to `localhost`
port: 8080, // Defaults to 8080
proxy: {
'/api': {
'target': 'http://localhost:3000/',
secure: false,
pathRewrite: {'^/api' : ''}
}
}
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ["babel-preset-env", "react"],
plugins: ["transform-object-rest-spread", "transform-class-properties","babel-plugin-react-css-modules"],
},
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /\.sass$/,
use: [
{ loader: "sass-loader" },
{ loader: "css-loader" },
{loader: "postcss"}
]
}
]
},
resolve: {
extensions: ['.js', '.jsx'],
},
output: {
path: __dirname + "/dist/",
filename: "mainCreated.js"
},
};