diff --git a/.changeset/early-pots-invite.md b/.changeset/early-pots-invite.md
new file mode 100644
index 0000000..6daca4b
--- /dev/null
+++ b/.changeset/early-pots-invite.md
@@ -0,0 +1,5 @@
+---
+"unplugin-sourcemaps": patch
+---
+
+Update README.md to add missing information about enabling sourcemaps
diff --git a/packages/unplugin-sourcemaps/README.md b/packages/unplugin-sourcemaps/README.md
index 701a9b4..e59b5be 100644
--- a/packages/unplugin-sourcemaps/README.md
+++ b/packages/unplugin-sourcemaps/README.md
@@ -12,9 +12,10 @@ Start by installing the package:
npm install unplugin-sourcemaps --save-dev
```
-Then register the bundler-specific plugin.
+Then register the bundler-specific plugin and enable the source maps.
-### Vite
+
+Vite
```javascript
// vite.config.js
@@ -25,11 +26,17 @@ import { ViteSourcemap } from 'unplugin-sourcemaps';
export default defineConfig( {
plugins: [
ViteSourcemap()
- ]
+ ],
+ build: {
+ sourcemap: true
+ }
} );
```
-### Rollup
+
+
+
+esbuild
```javascript
// rollup.config.js
@@ -38,13 +45,20 @@ import { defineConfig } from 'rollup';
import { RollupSourcemap } from 'unplugin-sourcemaps';
export default defineConfig( {
+ output: {
+ // Other options are skipped for brevity
+ sourcemap: true,
+ },
plugins: [
RollupSourcemap()
]
} );
```
-### esbuild
+
+
+
+esbuild
```javascript
import { build } from 'esbuild';
@@ -58,7 +72,10 @@ build( {
} );
```
-### webpack
+
+
+
+webpack
```javascript
// webpack.config.js
@@ -72,3 +89,5 @@ module.exports = {
],
};
```
+
+