-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
43 lines (40 loc) · 1.43 KB
/
craco.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
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const now = Math.floor(new Date().getTime() / 1000)
module.exports = {
webpack: {
configure: (config) => {
if (process.env.SENTRY_AUTH_TOKEN) {
config.plugins.push(
new SentryWebpackPlugin({
// sentry-cli configuration
authToken: process.env.SENTRY_AUTH_TOKEN,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
release:
process.env.REACT_APP_SENTRY_RELEASE ??
`${
process.env.VERCEL_GIT_COMMIT_REF ? process.env.VERCEL_GIT_COMMIT_REF.replace(/\//g, '--') : 'unknown'
}-${process.env.VERCEL_GIT_COMMIT_SHA ? process.env.VERCEL_GIT_COMMIT_SHA : 'unknown'}`,
// webpack specific configuration
include: './build/',
ignore: ['node_modules'],
setCommits: {
repo: process.env.GITHUB_REPO,
commit: process.env.GIT_COMMIT_SHA ?? process.env.VERCEL_GIT_COMMIT_SHA,
},
deploy: {
env: process.env.REACT_APP_SENTRY_ENVIRONMENT ?? process.env.VERCEL_ENV,
url: process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : undefined,
started: now,
},
})
)
}
return config
},
},
eslint: {
enable: false,
},
typescript: { enableTypeChecking: false },
}