-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathwebpack.plugins.ts
32 lines (30 loc) · 1.05 KB
/
webpack.plugins.ts
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
import { sentryWebpackPlugin } from '@sentry/webpack-plugin';
import { getSentryReleaseInfo } from './src/lib/sentry-release';
import type IForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import type { WebpackPluginInstance } from 'webpack';
const ForkTsCheckerWebpackPlugin: typeof IForkTsCheckerWebpackPlugin = require( 'fork-ts-checker-webpack-plugin' );
const version = process.env.npm_package_version || '';
const { release: sentryRelease, environment } = getSentryReleaseInfo( version );
console.log( 'Sentry release version:', sentryRelease );
console.log( 'Sentry environment:', environment );
export const plugins: WebpackPluginInstance[] = [
new ForkTsCheckerWebpackPlugin( {
logger: 'webpack-infrastructure',
issue: {
exclude: {
file: 'vendor/**/*',
},
},
} ),
// Sentry must be the last plugin
environment !== 'development' &&
!! process.env.SENTRY_AUTH_TOKEN &&
sentryWebpackPlugin( {
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'a8c',
project: 'studio',
release: {
name: sentryRelease,
},
} ),
];