-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
72 lines (66 loc) · 1.88 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
const webpack = require("webpack");
const path = require("path")
const BabiliPlugin = require("babili-webpack-plugin");
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
function requireDefault(module, value) {
try {
return require(module);
} catch(e) {
}
return value;
}
module.exports = {
entry: "./src/index.tsx",
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist")
},
resolve: {
extensions: [".scss", ".js", ".ts", ".tsx"]
},
module: {
loaders: [
{ test: /\.png$/, loaders: ["url-loader"] },
{ test: /\.scss$/, loaders: ["style-loader", "css-loader", "sass-loader"] },
{ test: /\.tsx?$/, loaders: ["ts-loader"] }
]
},
externals: {
config: JSON.stringify(requireDefault("./config.json", {}))
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
new webpack.ProvidePlugin({
config: "config",
jQuery: "jquery",
"window.Tether": "tether"
}),
new BabiliPlugin({
comments: false
}),
new FaviconsWebpackPlugin({
logo: "./src/images/transmission.png",
prefix: "icons/",
title: "Transmission",
icons: {
firefox: false
}
}),
new HtmlWebpackPlugin({
title: "Transmission",
template: "./src/index.html",
minify: {
collapseWhitespace: true,
removeComments: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true
}
})
]
};