1
Fork 0

update readme

This commit is contained in:
Conduitry 2018-11-13 08:44:56 -05:00
parent 4ca82ad39f
commit f5dbada574
1 changed files with 20 additions and 1 deletions

View File

@ -4,13 +4,32 @@ A simple Rollup plugin to allow the script and stylesheet portions of a Svelte c
## Requirements
- Node 8+
- Node 6+
- Rollup 0.61+
## Installation
This is not published to npm. Install from Git tags.
## Usage
Import `svelteCombiner` in your `rollup.config.js`. Place `svelteCombiner()` in your array of Rollup plugins before the main `svelte` plugin.
```javascript
import svelte from 'rollup-plugin-svelte';
import svelteCombiner from 'rollup-plugin-svelte-combiner';
export default {
// ...
plugins: [
// ...
svelteCombiner(),
svelte(),
// ...
],
};
```
The main file of a component is by default expected to have an `.html` or `.svelte` extension. This can be configured by initializing the plugin with `svelteCombiner({ extensions: ['.something', '.another'] })`. These should typically be set to the same `extensions` as are passed to the main `svelte` plugin.
The javascript portion of the component should have the same path and filename but with a `.js` extension. The stylesheet portion of the component should have the same path and filename but with a `.css` extension.