-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (46 loc) · 1.1 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
const webpack = require("webpack");
const html = require('html-webpack-plugin');
const minimize = process.argv.indexOf("--optimize-minimize") !== -1;
var plugins = [
new html({
template: './templates/template.ejs',
inject: "head"
})
];
if (minimize) {
plugins.push(new webpack.optimize.UglifyJsPlugin({
sourceMap: true
}));
}
const packageName = "[name]";
module.exports = [{
entry: {
"Coveo": "./src/Index.ts",
},
output: {
path: require("path").resolve("./dist/"),
filename: minimize ? `${packageName}.min.js` : `${packageName}.js`,
chunkFilename: minimize ? `${packageName}.min.js` : `${packageName}.js`,
libraryTarget: "umd",
library: "[name]",
publicPath: "",
devtoolModuleFilenameTemplate: "[resource-path]"
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
devtool: "source-map",
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
configFile: 'tsconfig.json',
}
},
]
},
plugins: plugins,
bail: true
}]