1.0.1 • Published 4 years ago

svelte-trim-whitespace-preprocessor v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

svelte-trim-whitespace-preprocessor

Trim whitespace between inline elements in Svelte components

Install via

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:

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

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

Here it is in code:

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