Skip to content
Merged
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
@@ -1,11 +1,12 @@
```javascript
```javascript {filename:webpack.config.js}
module.exports = {
devtool = 'source-map',
output: {
// Make maps auto-detectable by sentry-cli
filename: "[name].js",
sourceMapFilename: "[name].js.map",
// Other `output` configuration
},
// Other configuration
// Other webpack configuration
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { withSentryConfig } = require("@sentry/nextjs");

const moduleExports = {
webpack: (config, options) => {
devtool = 'source-map',
config.devtool = "source-map";
config.output = {
...config.output,
// Make maps auto-detectable by sentry-cli
Expand All @@ -12,15 +12,10 @@ const moduleExports = {
};
return config;
},
productionBrowserSourceMaps: true,
// Other nextjs configuration
};

const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin.
};

module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
module.exports = withSentryConfig(moduleExports);
```

Learn more about the Webpack usage for the Next.js SDK in [Extend Default Webpack Usage](/platforms/javascript/guides/nextjs/manual-setup/#extend-nextjs-configuration).
Learn more about the Webpack usage for the Next.js SDK in our [Manual Setup Guide](/platforms/javascript/guides/nextjs/manual-setup/#extend-nextjs-configuration).
31 changes: 15 additions & 16 deletions src/platforms/javascript/common/sourcemaps/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,21 @@ You may configure [sentry-cli](/product/cli/configuration/) through its document
const SentryWebpackPlugin = require("@sentry/webpack-plugin");

module.exports = {
// other configuration
configureWebpack: {
plugins: [
new SentryWebpackPlugin({
// sentry-cli configuration
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
release: process.env.SENTRY_RELEASE,

// webpack specific configuration
include: ".",
ignore: ["node_modules", "webpack.config.js"],
}),
],
},
// other webpack configuration
devtool = 'source-map',
plugins: [
new SentryWebpackPlugin({
// sentry-cli configuration
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
release: process.env.SENTRY_RELEASE,

// webpack-specific configuration
include: ".",
ignore: ["node_modules", "webpack.config.js"],
}),
],
};
```

Expand Down
29 changes: 14 additions & 15 deletions src/platforms/javascript/common/sourcemaps/tools/webpack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,20 @@ You may configure [sentry-cli](/product/cli/configuration/) through it's documen
const SentryWebpackPlugin = require("@sentry/webpack-plugin");

module.exports = {
// other configuration
configureWebpack: {
plugins: [
new SentryWebpackPlugin({
// sentry-cli configuration
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",

// webpack specific configuration
include: "./dist",
ignore: ["node_modules", "webpack.config.js"],
}),
],
},
// other webpack configuration
devtool = 'source-map',
plugins: [
new SentryWebpackPlugin({
// sentry-cli configuration
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",

// webpack-specific configuration
include: "./dist",
ignore: ["node_modules", "webpack.config.js"],
}),
],
};
```

Expand Down