forked from coordinape/coordinape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
78 lines (75 loc) · 2.51 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
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
const webpack = require('webpack');
const SentryCliPlugin = require('@sentry/webpack-plugin');
const {
SENTRY_AUTH_TOKEN,
VERCEL,
VERCEL_ENV,
VERCEL_GIT_COMMIT_SHA,
VERCEL_URL,
} = process.env;
const shouldDryRun = !(
VERCEL &&
SENTRY_AUTH_TOKEN &&
VERCEL_ENV !== 'development'
);
module.exports = {
webpack: {
configure: {
module: {
rules: [
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
],
},
ignoreWarnings: [/Failed to parse source map/],
resolve: {
fallback: {
os: require.resolve('os-browserify'),
crypto: require.resolve('crypto-browserify'),
http: require.resolve('http-browserify'),
https: require.resolve('https-browserify'),
stream: require.resolve('stream-browserify'),
util: require.resolve('util/'),
assert: require.resolve('assert/'),
buffer: require.resolve('buffer/'),
},
},
plugins: [
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
new SentryCliPlugin({
// include the transpiled js and sourcemaps
include: 'build',
// Release will utilize the vercel-specified sha if available.
// Otherise the current branch HEAD's sha will be used instead.
// These are functionally the same, but its a small optimization
// when running in CI, and ensures compatibility across all
// integrations.
release: VERCEL_GIT_COMMIT_SHA,
// Dry run in development environments or if the Sentry Auth token
// is absent. Simply logging a webpack warning will still cause
// compilation to fail in CI, so we want to avoid that.
dryRun: shouldDryRun,
ignore: ['node_modules', 'craco.config.js'],
org: 'coordinape',
project: 'app',
deploy: {
// Commits are auto-associated from the production Vercel environment
// by the Sentry-GitHub integration. The token provided to Vercel
// is not given the `org:read` permission necessary to
// set commits.
env: VERCEL_ENV,
// Not sure where this shows up in the Sentry UI, but if we can
// include it, why not?
// Sentry complains without a protocol prefix, which Vercel does
// not provide
url: 'https://' + VERCEL_URL,
},
}),
],
},
},
};