0.0.6 • Published 4 years ago

formality-loader-tmp v0.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

formality-loader

formality-loader compiles imported Formality files into a JavaScript module.

Install

With webpack correctly installed, add the formality-loader dependency:

$ npm install formality-loader --save-dev

Then add the loader to your webpack config file:

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.fm$/,
        loader: 'formality-loader',
        options: {
          typeCheckMode: 'all' // Options: all, none, production, development. Default: all
        }
      }
    ]
  }
}

Using

In your JavaScript file, import (or require) your Formality files including the .fm extension.

src/index.js

import app from './App.fm'

console.log(app(10))

src/App.fm

import Base#

main(n: Number) : Number
  2 .*. n

Check the examples folder for more info.

0.0.6

4 years ago

0.0.1

4 years ago