-
Notifications
You must be signed in to change notification settings - Fork 15
/
webpack.config.js
35 lines (31 loc) · 984 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
35
const fs = require('fs');
const path = require('path');
const { name, version } = require('./package.json');
const metadata = JSON.stringify({ name, version });
fs.writeFileSync('./lib/metadata.js', `Object.assign(exports, ${metadata})`);
const externals = [/^@jupyterlab\/.+$/, /^@jupyter-widgets\/.+$/];
module.exports = [
/**
* Embeddable bundle
*
* This bundle is almost identical to the notebook extension bundle. The only
* difference is in the configuration of the webpack public path for the
* static assets.
*
* The target bundle is always `dist/index.js`, which is the path required by
* the custom widget embedder.
*/
{
entry: './lib/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'amd',
library: name,
publicPath: `https://unpkg.com/${name}@${version}/dist/`
},
externals,
devtool: 'source-map',
performance: { hints: false }
}
];