Skip to content

Commit

Permalink
webpack sentry plugin disabled outside of production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Jul 26, 2024
1 parent a62edf5 commit 81fee3a
Showing 1 changed file with 59 additions and 57 deletions.
116 changes: 59 additions & 57 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,67 @@
const { VueLoaderPlugin } = require('vue-loader');
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');

const peachJamConfig = {
mode: 'development',
resolve: {
alias: {
vue: '@vue/runtime-dom'
module.exports = (env, argv) => {
return [{
mode: 'development',
resolve: {
alias: {
vue: '@vue/runtime-dom'
},
modules: [
'./node_modules'
],
extensions: ['.tsx', '.ts', '.js']
},
entry: {
app: './peachjam/js/app.ts',
'pdf.worker': 'pdfjs-dist/build/pdf.worker.entry'
},
modules: [
'./node_modules'
],
extensions: ['.tsx', '.ts', '.js']
},
entry: {
app: './peachjam/js/app.ts',
'pdf.worker': 'pdfjs-dist/build/pdf.worker.entry'
},
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
compilerOptions: {
isCustomElement: tag => tag.startsWith('la-')
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
compilerOptions: {
isCustomElement: tag => tag.startsWith('la-')
}
}
}
}
]
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
}
]
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
}
]
},
output: {
filename: '[name]-prod.js',
path: __dirname + '/peachjam/static/js'
},
devtool: 'source-map',
plugins: [
new VueLoaderPlugin(),
sentryWebpackPlugin({
disable: argv.mode !== 'production',
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'lawsafrica',
project: 'lii',
telemetry: false
})
]
},
output: {
filename: '[name]-prod.js',
path: __dirname + '/peachjam/static/js'
},
devtool: 'source-map',
plugins: [
new VueLoaderPlugin(),
sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'lawsafrica',
project: 'lii',
telemetry: false
})
]
};
}];
}

module.exports = [peachJamConfig];

0 comments on commit 81fee3a

Please sign in to comment.