Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/after-upload-deletion.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/basic.js",
output: {
path: resolve("./out/after-upload-deletion"),
filename: "basic.js",
},
devtool: "source-map",
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"basic.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="33730b8e-5b8d-4795-94b2-666cea28fce6",e._sentryDebugIdIdentifier="sentry-dbid-33730b8e-5b8d-4795-94b2-666cea28fce6");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
// eslint-disable-next-line no-console
console.log("hello world");

/******/ })()
;
//# sourceMappingURL=basic.js.map",
}
`);

const output = runFileInNode("basic.js");
expect(output).toBe("hello world\n");
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/application-key.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/basic.js",
output: {
path: resolve("./out/application-key"),
filename: "basic.js",
},
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"basic.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];if(null!=a)for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:1234567890abcdef":true});var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6438758c-c236-4f8b-af24-575a5948a617",e._sentryDebugIdIdentifier="sentry-dbid-6438758c-c236-4f8b-af24-575a5948a617");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
// eslint-disable-next-line no-console
console.log("hello world");

/******/ })()
;",
}
`);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/basic-release-disabled.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/basic.js",
output: {
path: resolve("./out/basic-release-disabled"),
filename: "basic.js",
},
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"basic.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6438758c-c236-4f8b-af24-575a5948a617",e._sentryDebugIdIdentifier="sentry-dbid-6438758c-c236-4f8b-af24-575a5948a617");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
// eslint-disable-next-line no-console
console.log("hello world");

/******/ })()
;",
}
`);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/basic-sourcemaps.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/basic.js",
output: {
path: resolve("./out/basic-sourcemaps"),
filename: "basic.js",
},
devtool: "source-map",
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"basic.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="33730b8e-5b8d-4795-94b2-666cea28fce6",e._sentryDebugIdIdentifier="sentry-dbid-33730b8e-5b8d-4795-94b2-666cea28fce6");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
// eslint-disable-next-line no-console
console.log("hello world");

/******/ })()
;
//# sourceMappingURL=basic.js.map",
"basic.js.map": "{"version":3,"file":"basic.js","mappings":";;;AAAA;AACA","sources":["webpack://rollup4-integration-tests/./src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"names":[],"sourceRoot":""}",
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
["releases","finalize","CURRENT_SHA"],
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],
",
}
`);

const output = runFileInNode("basic.js");
expect(output).toBe("hello world\n");
});
17 changes: 17 additions & 0 deletions packages/integration-tests-next/fixtures/webpack5/basic.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/basic.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/basic.js",
output: {
path: resolve("./out/basic"),
filename: "basic.js",
},
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
26 changes: 26 additions & 0 deletions packages/integration-tests-next/fixtures/webpack5/basic.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"basic.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6438758c-c236-4f8b-af24-575a5948a617",e._sentryDebugIdIdentifier="sentry-dbid-6438758c-c236-4f8b-af24-575a5948a617");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
// eslint-disable-next-line no-console
console.log("hello world");

/******/ })()
;",
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
["releases","finalize","CURRENT_SHA"],
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],
",
}
`);

const output = runFileInNode("basic.js");
expect(output).toBe("hello world\n");
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/build-info.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/basic.js",
output: {
path: resolve("./out/build-info"),
filename: "basic.js",
},
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"basic.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"build-information-injection-test"};e.SENTRY_BUILD_INFO={"deps":["@sentry/webpack-plugin","webpack","webpack-cli"],"depsVersions":{"webpack":5},"nodeVersion":"NODE_VERSION"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6438758c-c236-4f8b-af24-575a5948a617",e._sentryDebugIdIdentifier="sentry-dbid-6438758c-c236-4f8b-af24-575a5948a617");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
// eslint-disable-next-line no-console
console.log("hello world");

/******/ })()
;",
}
`);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/bundle-size-optimizations.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/bundle.js",
output: {
path: resolve("./out/bundle-size-optimizations"),
filename: "bundle.js",
},
optimization: {
minimize: false,
},
mode: "production",
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"bundle.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1ddfd748-f716-49b5-a6bb-a08a480112e2",e._sentryDebugIdIdentifier="sentry-dbid-1ddfd748-f716-49b5-a6bb-a08a480112e2");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";
console.log(
JSON.stringify({
debug: false ? 0 : "b",
trace: false ? 0 : "b",
replayCanvas: true ? "a" : 0,
replayIframe: true ? "a" : 0,
replayShadowDom: true ? "a" : 0,
replayWorker: true ? "a" : 0,
})
);

/******/ })()
;",
}
`);

const output = runFileInNode("bundle.js");
expect(output).toMatchInlineSnapshot(`
"{"debug":"b","trace":"b","replayCanvas":"a","replayIframe":"a","replayShadowDom":"a","replayWorker":"a"}
"
`);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
import { sentryConfig } from "../configs/component-annotation-disabled.config.js";
import { resolve } from "node:path";

export default {
cache: false,
entry: "./src/app.jsx",
output: {
path: resolve("./out/component-annotation-disabled"),
filename: "app.js",
},
optimization: {
minimize: false,
},
mode: "production",
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: [["@babel/preset-react", { runtime: "automatic" }]],
},
},
},
],
},
resolve: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
externals: {
react: "react",
"react/jsx-runtime": "react/jsx-runtime",
},
plugins: [sentryWebpackPlugin(sentryConfig)],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { expect } from "vitest";
import { test } from "./utils";

test(import.meta.url, ({ runBundler, readOutputFiles }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"app.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0c0c0033-ce3e-495b-a746-b130c60bc714",e._sentryDebugIdIdentifier="sentry-dbid-0c0c0033-ce3e-495b-a746-b130c60bc714");}catch(e){}}();
/******/ (() => { // webpackBootstrap
/******/ "use strict";

// UNUSED EXPORTS: default

;// external "react/jsx-runtime"
const jsx_runtime_namespaceObject = react/jsx-runtime;
;// ./src/component-a.jsx
/* unused harmony import specifier */ var _jsx;

function ComponentA() {
return /*#__PURE__*/_jsx("span", {
children: "Component A"
});
}
;// ./src/app.jsx
/* unused harmony import specifier */ var app_ComponentA;
/* unused harmony import specifier */ var app_jsx;
/* unused harmony import specifier */ var _jsxs;



function App() {
return /*#__PURE__*/_jsxs("span", {
children: [/*#__PURE__*/app_jsx(app_ComponentA, {}), ";"]
});
}
/******/ })()
;",
}
`);
});
Loading
Loading