Skip to content

Commit bfa534a

Browse files
authored
feat: add sentry plugin example (#135)
1 parent c7b117e commit bfa534a

6 files changed

Lines changed: 221 additions & 0 deletions

File tree

pnpm-lock.yaml

Lines changed: 173 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rspack/sentry/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
</body>
12+
</html>

rspack/sentry/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "example-sentry",
3+
"version": "1.0.0",
4+
"private": true,
5+
"license": "MIT",
6+
"sideEffects": ["**/*.css", "**/*.less", "**/*.scss"],
7+
"main": "index.js",
8+
"scripts": {
9+
"build": "rspack build",
10+
"dev": "rspack serve"
11+
},
12+
"devDependencies": {
13+
"@rspack/cli": "^1.0.3",
14+
"@rspack/core": "^1.0.3",
15+
"@sentry/webpack-plugin": "2.22.4"
16+
}
17+
}

rspack/sentry/rspack.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const rspack = require('@rspack/core');
2+
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
3+
/** @type {import('@rspack/cli').Configuration} */
4+
const config = {
5+
entry: './src/index.js',
6+
plugins: [
7+
new rspack.HtmlRspackPlugin({
8+
template: './index.html',
9+
}),
10+
sentryWebpackPlugin({}),
11+
],
12+
};
13+
module.exports = config;

rspack/sentry/src/answer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const answer = 42;

rspack/sentry/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { answer } from './answer';
2+
function render() {
3+
document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4+
}
5+
render();

0 commit comments

Comments
 (0)