forked from lusofonia/extenso.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
40 lines (38 loc) · 955 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
38
39
const path = require("path");
const webpack = require("webpack");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const pkg = require("./package.json");
const name = "Extenso.js";
const version = `v${pkg.version}`;
const license = pkg.license;
const currentYear = (new Date()).getFullYear();
const banner1 = `${name} ${version}`
const banner2 = `(c) 2015-${currentYear} Matheus Alves`;
const banner3 = `License: ${license}`;
const banner = banner1 + "\n" + banner2 + "\n" + banner3;
module.exports = {
entry: {
extenso: "./src/index.js",
"extenso.min": "./src/index.js"
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
library: "extenso",
libraryTarget: "umd"
},
module: {
rules: [
{
test: /\.js$/,
use: "babel-loader"
}
]
},
plugins: [
new UglifyJsPlugin({
include: /\.min\.js$/
}),
new webpack.BannerPlugin(banner)
]
};