formality-loader-tmp
v0.0.6
Published
Formality language loader for webpack
Downloads
6
Readme
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.