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.config.js
78 lines (77 loc) · 2.09 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
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
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$/
],
devtool: "inline-source-map",
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"]
}
]
},
devServer: {
https: false
},
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.CommonsChunkPlugin({
name: "Vendor",
minChunks: Infinity,
// (with more entries, this ensures that no other module
// goes into the vendor chunk)
})
]
}