-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.js
37 lines (35 loc) · 953 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
36
37
const path = require('path');
const { name, description, author, license, version } = require('./package.json');
const TerserPlugin = require('terser-webpack-plugin');
// package preamble
const preamble = `/*!\n ${name} - ${description}\n ${author.name} ${author.github} ${new Date().getFullYear()} ${license}\n ${version}\n*/`;
module.exports = {
mode: 'production',
entry: './src/instacam.js',
output: {
filename: 'instacam.umd.js',
path: path.resolve(__dirname, 'dist'),
library: 'Instacam',
libraryExport: 'default',
libraryTarget: 'umd',
umdNamedDefine: true,
},
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false,
preamble: preamble,
},
mangle: {
properties: {
regex: /^_/,
},
},
},
}),
],
},
};