Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit f524be2

Browse files
committed
add note about using in Node [ci-skip]
1 parent 1e4d2bf commit f524be2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ In your HTML:
9191
</body>
9292
```
9393

94+
If you are using `vueify` in Node:
95+
96+
``` js
97+
var fs = require("fs")
98+
var browserify = require('browserify')
99+
var vueify = require('vueify')
100+
101+
browserify('./entry.js')
102+
.transform(vueify)
103+
.bundle()
104+
.pipe(fs.createWriteStream("bundle.js"))
105+
```
106+
94107
## ES2015 by Default
95108

96109
Vueify 4.0+ automatically transforms the JavaScript in your `*.vue` components using Babel. Write ES2015 today!
@@ -164,6 +177,24 @@ module.exports = {
164177
}
165178
```
166179

180+
Alternatively, if you are using `vueify` in Node and don't want to create a `vue.config.js` file:
181+
182+
``` js
183+
var fs = require("fs")
184+
var browserify = require('browserify')
185+
var vueify = require('vueify')
186+
187+
// apply custom config
188+
vueify.compiler.applyConfig({
189+
// ...same as in vue.config.js
190+
})
191+
192+
browserify('./entry.js')
193+
.transform(vueify)
194+
.bundle()
195+
.pipe(fs.createWriteStream("bundle.js"))
196+
```
197+
167198
### Scoped CSS
168199

169200
> Experimental

0 commit comments

Comments
 (0)