/
webpack.config.js
84 lines (78 loc) · 2.11 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const webpack = require( 'webpack' );
const StatsPlugin = require( 'stats-webpack-plugin' );
const TerserPlugin = require( 'terser-webpack-plugin' );
module.exports = {
entry: './acdc.js',
mode: 'production',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
exclude: [
// polyfilled via web2017-polyfills ResourceLoader module:
'web.url',
'web.url-search-params',
// supported everywhere, we don’t care about the subtle edge cases that core-js polyfills:
'es.array.filter',
'es.array.includes',
'es.array.index-of', // not actually used, false positive from prefix.indexOf( '|' ) where prefix is a String, not an Array
'es.array.map',
'es.array.reduce',
'es.array.slice',
'es.array.some',
'es.array.splice',
'es.promise',
'es.set',
'es.string.replace',
'es.string.search', // not actually used, false positive from response.query.search where response is API response JSON
'es.string.split',
],
},
],
],
},
},
},
],
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin( {
extractComments: false,
} ),
],
},
output: {
environment: {
arrowFunction: false,
},
},
plugins: [
new webpack.BannerPlugin( `
Add to Commons / Descriptive Claims (ACDC)
Gadget to add a collection of statements to a set of files.
Documentation: [[Help:Gadget-ACDC]]
(https://commons.wikimedia.org/wiki/Help:Gadget-ACDC)
This version was built with webpack and Babel.
You can find the original source code on GitHub:
https://github.com/lucaswerkmeister/ACDC
That is also where development happens –
please do not edit this page directly –
and where you can find out more about the licenses
of some of the code (polyfills) included in this page.
` ),
new StatsPlugin( 'stats.json' ),
],
profile: true,
};