File tree Expand file tree Collapse file tree 4 files changed +67
-0
lines changed Expand file tree Collapse file tree 4 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ .npm
Original file line number Diff line number Diff line change 1+ # Integrate pug with vue single-file components for Meteor
2+
3+ Compatibility: ** Vue 1.x, Vue 2.x**
4+
5+ This meteor package adds [ pug] ( http://pugjs.org ) support in your single-file ` .vue ` components.
6+
7+ ## Installation
8+
9+ meteor add akryum:vue-pug
10+
11+
12+ ## Usage
13+
14+ ``` html
15+ <template lang =" pug" >
16+ .post
17+ .message {{data.message}}
18+ a.action(@click="removePost") x
19+ </template >
20+ ```
21+
22+ ---
23+
24+ LICENCE ISC - Created by Guillaume CHAU (@Akryum )
Original file line number Diff line number Diff line change 1+ Package . describe ( {
2+ name : 'akryum:vue-pug' ,
3+ version : '0.0.1' ,
4+ summary : 'Add pug support for vue components' ,
5+ git : 'https://github.com/Akryum/meteor-vue-component' ,
6+ documentation : 'README.md'
7+ } ) ;
8+
9+ Package . registerBuildPlugin ( {
10+ name : "vue-component-pug" ,
11+ use : [
12+ 'ecmascript@0.4.3'
13+ ] ,
14+ sources : [
15+ 'vue-pug.js'
16+ ] ,
17+ npmDependencies : {
18+ 'pug' : '2.0.0-beta11'
19+ }
20+ } ) ;
21+
22+ Package . onUse ( function ( api ) {
23+ api . use ( 'isobuild:compiler-plugin@1.0.0' ) ;
24+ } ) ;
Original file line number Diff line number Diff line change 1+ global . vue = global . vue || { }
2+ global . vue . lang = global . vue . lang || { }
3+
4+ import pug from 'pug' ;
5+ import { Meteor } from 'meteor/meteor' ;
6+
7+ global . vue . lang . pug = Meteor . wrapAsync ( function ( { source, inputFile } , cb ) {
8+ var fn = pug . compile ( source , {
9+ filename : inputFile . getPathInPackage ( ) ,
10+ fileMode : true
11+ } ) ;
12+
13+ var html = fn ( ) ;
14+
15+ cb ( null , {
16+ template : html
17+ } ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments