-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
31 lines (29 loc) · 1020 Bytes
/
webpack.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
const path = require('path');
const env = require('dotenv').config({ path: path.join(__dirname, `${process.env.NODE_ENV}.env`) });
const { DefinePlugin } = require('webpack');
const WorkersSentryWebpackPlugin = require('workers-sentry/webpack');
module.exports = {
entry: './src/index.js',
plugins: [
// Expose our environment in the worker
new DefinePlugin(Object.entries(env.parsed).reduce((obj, [ key, val ]) => {
obj[`process.env.${key}`] = JSON.stringify(val);
return obj;
}, { 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) })),
// Publish source maps to Sentry on each build
new WorkersSentryWebpackPlugin(
process.env.SENTRY_AUTH_TOKEN,
process.env.SENTRY_ORG,
process.env.SENTRY_PROJECT,
),
],
module: {
rules: [
{
test: /\.ya?ml$/,
type: 'json',
use: 'yaml-loader',
},
],
},
};