-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
48 lines (45 loc) · 1.39 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
const path = require('path');
const webpack = require('webpack');
const PACKAGE = require('./package.json');
const version = PACKAGE.version;
const date_now = new Date().toISOString().replace(/T.*/, '');
const BANNER = `
jsonpickle.js ${version} built on ${date_now}
Copyright (c) 2013-2019 Michael Scott Cuthbert and cuthbertLab. BSD License
http://github.com/cuthbertLab/jsonpickleJS
`;
module.exports = {
entry: './js/index.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'jsonpickle.min.js',
library: 'jsonpickle',
libraryTarget: 'umd',
umdNamedDefine: true,
},
mode: 'production',
devtool: 'source-map',
// mode: 'development',
// devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.js?$/,
exclude: /(node_modules|bower_components|soundfont|soundfonts)/,
use: [{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
// '@babel/transform-object-assign',
// '@babel/proposal-export-namespace-from',
],
},
}],
},
],
},
plugins: [
new webpack.BannerPlugin({banner: BANNER}),
],
};