This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.prod.config.js
79 lines (78 loc) · 2.09 KB
/
webpack.prod.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var path = require("path");
var webpack = require("webpack");
var CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
target: "web",
entry: {
Vendor: [
"./node_modules/filesaver.js/FileSaver.min.js",
"./node_modules/uuid/index.js"
],
Export: "./src/ExportBuildDefinition.ts",
Import: "./src/ImportBuildDefinition.ts"
},
output: {
filename: "src/[name].js",
libraryTarget: "amd"
},
externals: [
/^VSS\/.*/, /^TFS\/.*/, /^q$/
],
resolve: {
extensions: [
".webpack.js",
".web.js",
".ts",
".tsx",
".js"],
modules: [
"src",
"node_modules"
]
},
module: {
rules: [
{
test: /\.tsx?$/,
enforce: "pre",
loader: "tslint-loader",
options: {
emitErrors: true,
failOnHint: true
}
},
{
test: /\.tsx?$/,
loader: "ts-loader"
},
{
test: /\.s?css$/,
loaders: ["style", "css", "sass"]
}
]
},
plugins: [
new CopyWebpackPlugin([
{ from: "./src/*.html", to: "./" },
{ from: "./css", to: "css" },
{ from: "./libs", to: "libs" },
{ from: "./fonts", to: "fonts" },
{ from: "./images", to: "images" },
{ from: "./screenshots", to: "screenshots" },
{ from: "./vss-extension.json", to: "vss-extension.json" },
{ from: "./intro.md", to: "intro.md" },
{ from: "./license.txt", to: "license.txt" }
]),
new webpack.optimize.UglifyJsPlugin({
comments: false,
compress: {
warnings: true,
drop_console: true
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: "Vendor",
minChunks: Infinity,
})
]
}