-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
41 lines (38 loc) · 1.16 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
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
const webpack = require('webpack');
const pkg = require('./package');
const path = require('path');
const banner = `${pkg.name} ${pkg.version} - ${pkg.description}\nCopyright (c) ${new Date().getFullYear()} ${pkg.author} - ${pkg.homepage}\nLicense: ${pkg.license}`;
const webpackConfig = {
context: path.resolve(__dirname, 'src'),
entry: './index.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index.js',
library: 'MarkerAnimation',
libraryTarget: 'umd',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
],
},
externals: {
jquery: {
root: 'jQuery',
commonjs2: 'jquery',
commonjs: 'jquery',
amd: 'jquery',
},
},
plugins: [
new webpack.BannerPlugin(banner),
new DuplicatePackageCheckerPlugin(),
],
};
module.exports = (new SpeedMeasurePlugin()).wrap(webpackConfig);