-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
38 lines (33 loc) · 1.03 KB
/
webpack.config.js
File metadata and controls
38 lines (33 loc) · 1.03 KB
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
module.exports = {
entry: "./src/index.tsx",
output: {
filename: "bundle.js",
path: __dirname + "/dist"
},
// デバッグ用にソースマップの出力を有効にします。
devtool: "source-map",
resolve: {
// 解決可能な拡張子として、'.ts' と '.tsx' を追加します。
extensions: [".ts", ".tsx", ".js", ".json"]
},
module: {
rules: [
// 拡張子が .ts と .tsx のファイル を 'awesome-typescript-loader' で
// 扱うようにします。
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
// 出力されるすべての .js ファイルは、'source-map-loader' で
// 再加工されたソースマップを持ちます。
{ enforce: "pre", test: /\.js$/, loader: "source-map-loader" }
]
},
plugins: [
new webpack.DefinePlugin({
'process.env.GOOGLE_API': JSON.stringify(process.env.GOOGLE_API),
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
};