forked from node-opcua/node-opcua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
77 lines (74 loc) · 2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
const babiliWebpackPlugin = require("babili-webpack-plugin");
const MinifyPlugin = require("babel-minify-webpack-plugin");
// -------------------------------------------------------------
//
// -------------------------------------------------------------
const simple_client = {
target: "node",
context: __dirname,
entry: {
simple_server: "./packages/node-opcua-samples/bin/simple_server.js"
},
devtool: "source-map",
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].bundle.js"
},
node: {
__dirname: true,
fs: "empty",
net: "empty",
child_process: "empty"
},
resolve: {
// alias: {
// "node-opcua": "./node-opcua"
// }
},
externals: [
nodeExternals({
//xx whitelist: [/opcua/]
}),
"node-opcua"
],
module: {
rules: [
{
test: /.*\.js/,
loader: "shebang-loader"
}
]
},
// "spawn-sync", "camelcase", "string-width", "read-pkg-up", "os-locale", "memcpy", "yargs", "ursa", "usage", "require-main-filename"],
// module: {
// rules: [
// {
// test: /\.js$/,
// //xx exclude: [/node_modules/],
// loader: "babel-loader",
// query: {
// presets: ["es2015"],
// },
// }
// ]
// },
plugins: [
// new webpack.DllReferencePlugin({
// //context: path.join(__dirname, "dist", "dll"),
// manifest: require("./dist/opcua-manifest.json") // eslint-disable-line
// }),
//new MinifyPlugin({}/*minifyOpts*/, {}/*pluginOpts*/)
// new webpack.optimize.UglifyJsPlugin({
// minimize: true,
// compress:true
// })
// new babiliWebpackPlugin({
// mangle: { "topLevel": true },
// deadcode: true
// }),
]
};
module.exports = [simple_client];