Skip to content

Commit c42d0d6

Browse files
author
Guillaume Chau
committed
JSX support
1 parent f5d7ed0 commit c42d0d6

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

packages/vue-component/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
## 0.10.3 -2017-07-16
3+
## 0.10.5 - 2017-08-11
4+
5+
- Enable babelrc for vue files
6+
7+
## 0.10.3 - 2017-07-16
48

59
- Fixed component auto naming
610

packages/vue-component/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,38 @@ Packages for `<style>` tag:
150150

151151
Get involved! Add your own package with a PR! :+1:
152152

153+
### JSX
154+
155+
To add JSX support, install the following packages:
156+
157+
```
158+
meteor npm i -D babel-plugin-syntax-jsx babel-plugin-transform-vue-jsx
159+
```
160+
161+
Then add a `.babelrc` file in the root directory of the meteor project with the following content:
162+
163+
```json
164+
{
165+
"plugins": [
166+
"transform-vue-jsx"
167+
]
168+
}
169+
```
170+
171+
You can now use JSX in your Vue components:
172+
173+
```html
174+
<script>
175+
export default {
176+
render (h) {
177+
return <div class="home">
178+
<h1>#404</h1>
179+
</div>
180+
}
181+
}
182+
</script>
183+
```
184+
153185
### Manual import
154186

155187
You can then import your .vue component files in your meteor code:

packages/vue-component/package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'akryum:vue-component',
3-
version: '0.10.4',
3+
version: '0.10.5',
44
summary: 'VueJS single-file components that hot-reloads',
55
git: 'https://github.com/Akryum/meteor-vue-component',
66
documentation: 'README.md'

packages/vue-component/plugin/tag-handler.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ VueComponentTagHandler = class VueComponentTagHandler {
165165
// Babel
166166
if(useBabel) {
167167
// Babel options
168+
this.babelOptions.babelrc = true
168169
this.babelOptions.sourceMap = true;
169170
this.babelOptions.filename =
170171
this.babelOptions.sourceFileName = tag.basePath;

0 commit comments

Comments
 (0)