0.1.4 • Published 7 years ago

moon-component-compiler v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Moon Component Compiler

Compiler for Moon Single File Components

Single File Components

Single file components are a way to declare Moon components. Each can have a top level template, style, and script tag.

For example:

<template>
  <div>
    <h1>Component!</h1>
    <p>{{someProp}}</p>
  </div>
</template>

<style lang="stylus" scoped>
h1
  color blue
</style>

<script>
exports = {
  props: ['someProp']
}
</script>

As you can see, you can have scoped CSS, preprocessors, and organize your code!

Compiling

To compile a single file component (a .moonfile), you can do:

const compile = require("moon-component-compiler");
const compiled = compile("Head", component, {
  hotReload: true
});

The result will be an object containing:

  • The Moon component, exported through module.exports;
  • The styles extracted from the component

For example:

{
  component: "",
  style: ""
}

License

Licensed under the MIT License by Kabir Shah

0.1.4

7 years ago

0.1.3

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago