-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (39 loc) · 1.08 KB
/
webpack.config.js
File metadata and controls
41 lines (39 loc) · 1.08 KB
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
const path = require('path');
let dependencies = Object.keys(require('./package.json').dependencies).reduce(function (acc, cur) {
acc[cur] = cur
return acc
}, new Object());
module.exports = {
target: 'node',
entry: {
mongodb: './src/index.js',
},
externalsPresets: { node: true },
externals: dependencies,
mode: 'production',
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs2',
},
optimization: {
minimize: false,
},
devServer: {
// contentBase
static : {
directory : path.join(__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"
},
port: 3005,
devMiddleware: {
publicPath: "https://localhost:3000/dist/",
},
hot: "only",
},
stats: { warnings: false },
};