-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.lib.js
54 lines (51 loc) · 1.28 KB
/
webpack.lib.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
const path = require("path");
const fs = require("fs");
const webpack = require("webpack");
var dir_app = path.resolve(__dirname, "src");
var dir_build = path.resolve(__dirname, "build");
/*
* These are the environment variables that can
* be set when running webpack (for deployment)
*/
// end environment variables
module.exports = {
entry: [
// "babel-polyfill",
// "core-js",
// "react-hot-loader/patch",
// "webpack/hot/only-dev-server",
path.resolve(dir_app, "librpki")
],
target: "async-node",
mode: "production",
module: {
rules: [
{
test: /\.js[x]?$/,
//include: [/app/],
// includes don't work with linked (local) modules,
// such as the @ripe-rnd/ui-components
// so excluding is the way to go.
exclude: /.*node_modules\/((?!@ripe-rnd).)*$/,
use: ["babel-loader"]
}
]
},
resolve: {
extensions: ["*", ".js"],
symlinks: false
},
plugins: [
new webpack.DefinePlugin({
__RELEASE_STRING__: JSON.stringify(`rpki-web-test-${require("./package.json").version}`)
})
],
output: {
path: dir_build,
filename: "librpkitest.js",
library: "libRpkiTest",
libraryTarget: "commonjs2"
},
//context: dir_app,
devtool: "cheap-module-source-map"
};