-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathwebpack-dev-server.config.js
More file actions
36 lines (35 loc) · 997 Bytes
/
webpack-dev-server.config.js
File metadata and controls
36 lines (35 loc) · 997 Bytes
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
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
const webpack = require("webpack");
const config = require("./webpack.config");
module.exports = {
entry: "./src/webpack-dev-server.js",
plugins: [
...config[0].plugins,
new HtmlWebpackPlugin({
filename: "index.html",
template: "src/index.html"
}),
new webpack.EnvironmentPlugin({
"process.env.NODE_ENV": process.env.NODE_ENV
}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: config[0].module,
devServer: {
hot: true,
contentBase: __dirname,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers":
"X-Requested-With, content-type, Authorization"
}
},
resolve: {
alias: {
"remote-component.config.js": path.resolve("./remote-component.config.js")
}
}
};