Skip to content

Commit

Permalink
Update README.md to add missing information about enabling sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol committed Oct 9, 2024
1 parent 413c2b3 commit 6468b98
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-pots-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"unplugin-sourcemaps": patch
---

Update README.md to add missing information about enabling sourcemaps
31 changes: 25 additions & 6 deletions packages/unplugin-sourcemaps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<details>
<summary>Vite</summary>

```javascript
// vite.config.js
Expand All @@ -25,11 +26,17 @@ import { ViteSourcemap } from 'unplugin-sourcemaps';
export default defineConfig( {
plugins: [
ViteSourcemap()
]
],
build: {
sourcemap: true
}
} );
```

### Rollup
</details>

<details>
<summary>esbuild</summary>

```javascript
// rollup.config.js
Expand All @@ -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
</details>

<details>
<summary>esbuild</summary>

```javascript
import { build } from 'esbuild';
Expand All @@ -58,7 +72,10 @@ build( {
} );
```

### webpack
</details>

<details>
<summary>webpack</summary>

```javascript
// webpack.config.js
Expand All @@ -72,3 +89,5 @@ module.exports = {
],
};
```

</details>

0 comments on commit 6468b98

Please sign in to comment.