forked from jupyterlab/jupyterlab
/
webpack.config.js
57 lines (48 loc) · 1.12 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
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// Support for Node 0.10
// See https://github.com/webpack/css-loader/issues/144
require('es6-promise').polyfill();
var childProcess = require('child_process');
var buildExtension = require('@jupyterlab/extension-builder/lib/builder').buildExtension;
var webpack = require('webpack');
console.log('Generating bundles...');
try {
var notice = childProcess.execSync('git describe', { encoding: 'utf8' });
} catch (e) {
var notice = 'unknown';
}
buildExtension({
name: 'main',
entry: './build/main',
outputDir: './build',
config: {
output: {
publicPath: 'lab/',
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'GIT_DESCRIPTION': JSON.stringify(notice.trim())
}
})
]
}
});
module.exports = {
entry: {
loader: './build/loader'
},
output: {
path: __dirname + '/build',
filename: '[name].bundle.js',
libraryTarget: 'this',
library: 'jupyter'
},
node: {
fs: 'empty'
},
debug: true,
bail: true,
devtool: 'source-map'
}