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
- Host: GitHub
- URL: https://github.com/kim366/svelte-trim-whitespace-preprocessor
- Owner: kim366
- Created: 2020-10-11T12:40:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-11T13:03:25.000Z (over 5 years ago)
- Last Synced: 2026-03-31T09:15:34.340Z (3 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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});
```