This repository was archived by the owner on Dec 26, 2018. It is now read-only.
File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -287,11 +287,13 @@ Via API:
287
287
browserify (' ./main.js' )
288
288
.transform (' vueify' )
289
289
.plugin (' vueify/plugins/extract-css' , {
290
- out: ' dist/bundle.css'
290
+ out: ' dist/bundle.css' // can also be a WritableStream
291
291
})
292
292
.bundle ()
293
293
```
294
294
295
+ This only works for vueify 9+. For Vue 1.x / vueify 8.x you can use [ vueify-extract-css] ( https://github.com/rawcreative/vueify-extract-css ) .
296
+
295
297
## Compiler API
296
298
297
299
The compiler API (originally ` vue-component-compiler ` ) is also exposed:
Original file line number Diff line number Diff line change @@ -8,15 +8,18 @@ module.exports = function (b, opts) {
8
8
9
9
var styles = Object . create ( null )
10
10
var outPath = opts . out || opts . o || 'bundle.css'
11
- if ( typeof outPath === 'function' ) {
12
- outPath = outPath ( )
13
- }
14
11
15
12
b . on ( 'bundle' , function ( bs ) {
16
13
bs . on ( 'end' , function ( ) {
17
- fs . writeFile ( outPath , Object . keys ( styles )
14
+ var css = Object . keys ( styles )
18
15
. map ( function ( file ) { return styles [ file ] } )
19
- . join ( '\n' ) )
16
+ . join ( '\n' )
17
+ if ( typeof outPath === 'object' && outPath . write ) {
18
+ outPath . write ( css )
19
+ outPath . end ( )
20
+ } else if ( typeof outPath === 'string' ) {
21
+ fs . writeFile ( outPath , css )
22
+ }
20
23
} )
21
24
} )
22
25
You can’t perform that action at this time.
0 commit comments