Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pingpong-im/meteor-sfc

Single file components for meteor and blaze
https://github.com/pingpong-im/meteor-sfc

blaze meteor

Last synced: 2 months ago
JSON representation

Single file components for meteor and blaze

Awesome Lists containing this project

README

        

# meteor-sfc

This package implements single file component for meteor.js

Regular meteor approach is to put html, less and js into different files.

But having all in single file component is more visual.

Inspired by https://vuejs.org/v2/guide/single-file-components.html

## Installation

npm i -g meteor-sfc

## Usage

Put all code into file with .ui extension

example.ui
~~~~


{{name}}


Template.hacker.helpers({
name () {
return 'Neo'
}
})

.hacker_name {
color: yellow;
background-color: #333;
}

~~~~

meteor-sfc will parse **example.ui** and create at the same level:

**example.html** with handlebars templates

**example.less** with styles

**example.js** with scripts

### Parse single file

meteor-sfc --file ./components/example.ui

note: you can add meteor-sfc as a filewatcher to webstorm IDE

### Watch directory

meteor-sfc --dir ./components