forked from ryohey/signal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
52 lines (51 loc) · 1.41 KB
/
webpack.prod.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
const { merge } = require("webpack-merge")
const common = require("./webpack.common.js")
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin
const CopyPlugin = require("copy-webpack-plugin")
const SentryWebpackPlugin = require("@sentry/webpack-plugin")
module.exports = merge(common, {
mode: "production",
devtool: "source-map",
module: {
rules: [
{
test: /\.(j|t)sx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
],
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "public/*.sf2", to: "[name][ext]" },
{ from: "public/*.svg", to: "[name][ext]" },
{ from: "public/*.png", to: "[name][ext]" },
{ from: "public/*.js", to: "[name][ext]" },
{ from: "public/*.webmanifest", to: "[name][ext]" },
{ from: "public/*.css", to: "[name][ext]" },
],
}),
new BundleAnalyzerPlugin({
analyzerMode: "static",
openAnalyzer: false,
}),
new SentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "codingcafe_jp",
project: "signal",
release: process.env.VERCEL_GIT_COMMIT_SHA,
include: "./dist",
ignore: [
"node_modules",
"webpack.common.js",
"webpack.dev.js",
"webpack.prod.js",
],
dryRun: process.env.VERCEL_ENV !== "production",
}),
],
})