forked from mudcube/MIDI.js
-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
57 lines (54 loc) · 1.73 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
const path = require('path');
const webpack = require('webpack');
const ESLintPlugin = require('eslint-webpack-plugin');
const PACKAGE = require('./package.json');
const version = PACKAGE.version;
const date_now = new Date().toISOString().replace(/T.*/, '');
const BANNER = `
midicube ${version} built on ${date_now}.
`;
module.exports = {
entry: './js/index.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'midicube.js',
library: 'MIDI',
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',
{
// do not transform modules; let webpack do it
modules: false,
useBuiltIns: 'usage',
corejs: 3,
}
],
],
plugins: [
'@babel/plugin-transform-object-assign',
'@babel/plugin-proposal-export-namespace-from',
],
},
}],
},
],
},
plugins: [
new webpack.BannerPlugin({banner: BANNER}),
new ESLintPlugin(),
],
};