Skip to content

Latest commit

 

History

History
98 lines (58 loc) · 3.25 KB

README.md

File metadata and controls

98 lines (58 loc) · 3.25 KB

This project is depricated. Only for meteor < 1.3 #For meteor 1.3+ we have Synthesis

Compiler

What is mwc (meteor-webcomponents) compiler ?

Automates Polymer vulcanizing in Meteor

Why ?

Actually its difficult to code Polymer with Meteor, Meteor not support extra <template> tag, You can solve it by 2 ways

  • Keep all bower_components, custom polymer elements, etc in public folder, Manually vulcanize, Delete bower_components after vulcanizing (bower_compuments increases app size)
  • Keep html inside javascript (like .jsx in react)

mwc:compiler automatically watch Polymer project folder anywhere in local file system & added to meteor after vulcanizing

How to use it ?

Install mwc:compiler package to your Meteor App

    $ meteor add mwc:compiler

Keep the compiler.mwc.json named configuration file with the following properties under /client folder of your Meteor App.

  • root[String] : Root directory from which html,js,css,etc files to be compiled and vulcanized. Root directory should be a .(dot) folder to avoid meteor watching the files. Compiler has a dedicated watcher to do that. eg .polymer.
  • append [Array] : Files specified here will be appended to web.bowser, web.cordova builds after vulcanizing.
  • import [Array] : Files to be vulcanised to public/mwc_compiler.html & imported to <head>.

Here is a sample compiler.mwc.json:

{
    "root" : ".polymer",

    "append": [
        "index.html",
        "my_class.html"
    ],

    "import": [
        "bower_components/font-roboto/roboto.html",

        "bower_components/paper-header-panel/paper-header-panel.html",
        "bower_components/paper-scroll-header-panel/paper-scroll-header-panel.html",

        "bower_components/polymer/polymer.html",

        "linto/card-route.html"
    ], 
    "extensions": {
        "mwc:[email protected]": {
            "compileFunction": "MWCEcmascript"
        }
    }
}

Refer https://github.com/meteorwebcomponents/extensions for more details on extensions.

Keep all bower_components, custom polymer elements, etc in the root (here it will be .polymer) vulcanizer root directory.

##Related Projects

MWC Mixin - Mixin for polymer/webcomponents in meteor.

MWC Router - Reactive routing for polymer/webcomponents in meteor.

MWC Layout - polymer layout renderer

Demo

screen shot 2016-02-12 at 2 16 47 pm

screen shot 2016-02-12 at 2 22 25 pm