-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
54 lines (50 loc) · 1.11 KB
/
webpack.config.prod.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
"use strict";
const path = require("path");
const webpack = require("webpack");
// Generate the description file d.ts
function DtsBundlePlugin() { }
DtsBundlePlugin.prototype.apply = function (compiler) {
compiler.plugin("done", function () {
var dts = require("dts-bundle");
dts.bundle({
name: "FatinaPluginHelpers",
baseDir: "lib",
main: "./lib/src/index.d.ts",
out: "../build/fatina-plugin-helpers.d.ts",
exclude: (file, external) => {
return file.indexOf("tests") !== -1;
},
removeSource: true,
verbose: false,
outputAsModuleFolder: true // to use npm in-package typings
});
});
};
module.exports = {
mode: "production",
entry: "./src/index.ts",
output: {
path: path.resolve(__dirname, "build"),
filename: "fatina-plugin-helpers.min.js",
library: "FatinaPluginHelpers",
libraryTarget: "umd",
umdNamedDefine: true,
globalObject: "typeof self !== 'undefined' ? self : this"
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{ loader: "ts-loader" }
]
}
]
},
plugins: [
new DtsBundlePlugin()
]
};