Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/pingpong-im/meteor-sfc
- Owner: pingpong-im
- License: mit
- Created: 2017-05-25T16:50:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-17T16:30:27.000Z (over 6 years ago)
- Last Synced: 2024-11-16T09:30:47.695Z (2 months ago)
- Topics: blaze, meteor
- Language: JavaScript
- Homepage:
- Size: 348 KB
- Stars: 2
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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