-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (32 loc) · 929 Bytes
/
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
/* webpack.config.js */
const fs = require("fs");
const path = require('path');
const WebBundlePlugin = require('webbundle-webpack-plugin');
const {
NodeCryptoSigningStrategy,
parsePemKey,
WebBundleId,
} = require('wbn-sign');
const privateKeyFile = "ed25519key.pem";
if (!fs.existsSync(privateKeyFile)) {
throw new Error("Cannot read private key.");
}
const privateKey = fs.readFileSync(privateKeyFile);
const key = parsePemKey(privateKey);
module.exports = async () => {
return {
entry: './static/index.js',
mode: 'development',
output: { path: __dirname },
plugins: [
new WebBundlePlugin({
baseURL: new WebBundleId(key).serializeWithIsolatedWebAppOrigin(),
static: { dir: path.resolve(__dirname, 'static') },
output: 'iwa-windowing-example.swbn',
integrityBlockSign: {
strategy: new NodeCryptoSigningStrategy(key),
},
}),
],
};
};