-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
60 lines (59 loc) · 1.99 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
58
59
60
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = (env, argv) => ({
entry: {
'convey-std': './src/std.wpk.ts',
'convey-all': './src/all.wpk.ts',
'convey-map': './src/map.wpk.ts',
'convey-vis': './src/vis.wpk.ts',
'convey-aud': './src/aud.wpk.ts',
'convey-cod': './src/cod.wpk.ts',
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
exclude: /node_modules/,
query: {
// we don't want any declaration file in the bundles
// folder since it wouldn't be of any use ans the source
// map already include everything for debugging
declaration: false,
inlineSources: false,
sourceMap: false
}
},
{
test: /\.(css|scss)$/,
exclude: /node_modules/,
use: [
argv.mode === 'production' ? MiniCssExtractPlugin.loader : 'style-loader',
'css-loader',
'sass-loader',
'import-glob-loader'
],
},
],
},
resolve: {
extensions: ['.ts', '.js', '.tsx', '.scss'],
},
// Activate source maps for the bundles in order to preserve the original
// source when the user debugs the application
devtool: 'source-map',
output: {
library: 'GaiaConvey',
libraryTarget: 'umd',
filename: 'dist/[name].js',
path: __dirname,
umdNamedDefine: true,
// see: https://github.com/webpack/webpack/issues/6784
globalObject: 'typeof self !== \'undefined\' ? self : this'
},
externals: ['@zxing/library', 'reveal.js', 'browser-image-compression'],
plugins: [
new MiniCssExtractPlugin({
filename: 'dist/[name].css',
}),
],
});