-
Notifications
You must be signed in to change notification settings - Fork 17
/
webpack.config.js
49 lines (44 loc) · 1.15 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
const webpack = require('webpack');
const resolve = require('path').resolve;
module.exports = {
mode: "development",
resolve: {
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js", ".jsx"],
alias: {
"handlebars" : 'handlebars/dist/handlebars.js'
}
},
entry: [
"react-hot-loader/patch", // activate HMR for React
"webpack-dev-server/client?http://localhost:8080/",
"webpack/hot/only-dev-server",
"./src/dev.tsx"
],
output: {
filename: "bundle.js",
path: resolve(__dirname, "public")
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
devServer: {
historyApiFallback: true,
hot: true, // enable HMR on the server
contentBase: resolve(__dirname, "public"), // match the output path
publicPath: "/" // match the output `publicPath`
},
module: {
rules: [
{ test: /\.js$/, loader: "source-map-loader"},
{ test: /\.tsx?$/, loader: "awesome-typescript-loader"}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin()
],
node:{
fs: 'empty',
net: 'empty',
tls: 'empty'
}
};