forked from hyperledger-archives/aries-framework-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.rest.js
54 lines (46 loc) · 1.34 KB
/
webpack.config.rest.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
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
const path = require("path")
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const WebpackShellPlugin = require('webpack-shell-plugin')
const { PATHS } = require("./webpack.config.common.js")
const OUTPUT = path.join(PATHS.buildDir, "rest/")
const restConfig = {
entry: path.join(PATHS.srcDir, "aries.js"),
target: 'web',
output: {
path: OUTPUT,
publicPath: "dist/rest",
libraryTarget: "umd",
filename: 'aries.js',
library: 'Aries'
},
plugins: [
new CleanWebpackPlugin(),
new WebpackShellPlugin({
onBuildStart: [
"mkdir -p " + OUTPUT,
"cp -p src/worker-impl-rest.js dist/assets"
]
})
],
resolve: {
alias: {
worker_loader$: path.join(PATHS.srcDir, "worker-loader-rest.js"),
},
mainFields: ['browser', 'module', 'main']
}
}
const assetConfig = {
entry: path.join(PATHS.srcDir, "agent-rest-client.js"),
target: 'webworker',
output: {
path: path.resolve(PATHS.buildDir, 'assets'),
publicPath: "dist/assets",
filename: 'agent-rest-client.js',
library: "RESTAgent"
},
}
module.exports = [ restConfig, assetConfig ];