An open API service indexing awesome lists of open source software.

https://github.com/kim366/svelte-trim-whitespace-preprocessor

Trim whitespace between inline elements in Svelte components
https://github.com/kim366/svelte-trim-whitespace-preprocessor

Last synced: about 1 month ago
JSON representation

Trim whitespace between inline elements in Svelte components

Awesome Lists containing this project

README

          

# svelte-trim-whitespace-preprocessor
Trim whitespace between inline elements in Svelte components

Install via

```bash
npm i -D svelte-trim-whitespace-preprocessor
```

Then, wherever you preprocess Svelte components, add the imported object. Here is an example with the Rollup config:

```js

import trimWhitespacePreprocessor from 'svelte-trim-whitespace-preprocessor';

export default {
client: {
// ...
plugins: [
svelte({
// ...
preprocess: trimWhitespacePreprocessor
})
]
},
server: {
// ...
plugins: [
svelte({
// ...
preprocess: trimWhitespacePreprocessor
})
]
}
}
```

Here it is in code:

```js
svelte.preprocess(content, trimWhitespacePreprocessor, {filename});
```