Skip to content

Commit af6228d

Browse files
committed
docs: Include Sentry Webpack Plugin in the Source Maps section
1 parent 0362926 commit af6228d

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

docs/sourcemaps.rst

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@ sourcemaps) within Sentry. This removes the requirement for them to be
145145
web-accessible, and also removes any inconsistency that could come from
146146
network flakiness (on either your end, or Sentry's end).
147147

148-
You can either interact with the API directly or you can upload sourcemaps
149-
with the help of the Sentry CLI (:ref:`upload-sourcemaps-with-cli`).
148+
You can either interact with the API directly, upload sourcemaps
149+
with the help of the Sentry CLI (:ref:`upload-sourcemaps-with-cli`)
150+
or you can use ``sentry-webpack-plugin``.
150151

151-
* Start by creating a new authentication token under **[Account] > API**.
152-
* Ensure you you have ``project:write`` selected under scopes.
152+
* Start by creating a new authentication token under `**[Account] > API** <https://sentry.io/api/>`_.
153+
* Ensure you have ``project:write`` selected under scopes.
153154
* You'll use the Authorization header with the value of ``Bearer: {TOKEN}``
154155
with API requests.
155156

@@ -302,6 +303,35 @@ the ``--ext`` parameter.
302303
* Make sure that your minified files you have on your servers
303304
actually have references to your files.
304305

306+
Using Sentry Webpack Plugin
307+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308+
309+
Another way to manage releases and sourcemaps on Sentry, is to use the Sentry Webpack Plugin.
310+
311+
* Start by creating a new authentication token under `**[Account] > API** <https://sentry.io/api/>`_.
312+
* Ensure you have ``project:write`` selected under scopes.
313+
* Install ``@sentry/webpack-plugin`` using ``npm``
314+
* Create ``.sentryclirc`` file with necessary config (see Sentry Webpack Plugin docs below)
315+
* Update your ``webpack.config.json``
316+
317+
::
318+
319+
const SentryPlugin = require('@sentry/webpack-plugin');
320+
321+
module.exports = {
322+
// ... other config above ...
323+
plugins: [
324+
new SentryPlugin({
325+
release: process.env.RELEASE,
326+
include: './dist',
327+
ignore: ['node_modules', 'webpack.config.js'],
328+
})
329+
]
330+
};
331+
332+
333+
You can take a look at `Sentry Webpack Plugin documentation <https://github.com/getsentry/sentry-webpack-plugin>`_
334+
for more information on how to configure the plugin.
305335

306336
.. sentry:edition:: hosted
307337

0 commit comments

Comments
 (0)