Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 7889a7c

Browse files
committed
Add documentation about css option
1 parent f3b0f27 commit 7889a7c

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,45 @@ rollup({
5656
});
5757
```
5858

59+
Below is how you can use it from the command line with Bublé.
60+
Run `rollup -c` and it will find the config.
61+
62+
```js
63+
// rollup.config.js
64+
import vue from 'rollup-plugin-vue'
65+
import buble from 'rollup-plugin-buble' // rollup-plugin-babel also works
66+
67+
export default {
68+
entry: 'index.js',
69+
plugins: [
70+
vue(),
71+
buble()
72+
]
73+
}
74+
```
75+
76+
### Options
77+
78+
```js
79+
vue({
80+
// Filename to write all styles to
81+
css: 'bundle.scss',
82+
83+
// Callback that will be called ongenerate with two arguments:
84+
// - styles: the contents of all style tags combined
85+
// - styleNodes: an array of style objects: [{lang: 'css', content: 'body { color: green }'}]
86+
css: function (styles, styleNodes) {
87+
writeFileSync(cssPath, styles)
88+
}
89+
90+
// Disable any style output or callbacks
91+
css: false,
92+
93+
// Default behaviour is to write all styles to the bundle destination where .js is replaced by .css
94+
css: null
95+
})
96+
```
97+
5998
## Change log
6099

61100
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
@@ -77,7 +116,7 @@ If you discover any security related issues, please email hi@znck.me instead of
77116
## Credits
78117

79118
- [Rahul Kadyan][link-author]
80-
- [Thomas Ghysels](https://github/thgh)
119+
- [Thomas Ghysels](https://github.com/thgh)
81120
- [All Contributors][link-contributors]
82121

83122
## License

0 commit comments

Comments
 (0)