New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

moon-component-compiler

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moon-component-compiler

Compiler for Moon Single File Components

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

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

Keywords

compiler

FAQs

Package last updated on 09 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts