node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

fable-compiler-loader

Fable Webpack loader

npm

Usage

This is a simple Webpack loader that compiles F# code to JavaScript using Fable.

To use it, first install the package:

$ npm install --save fable-compiler-loader

then configure the loader in your Webpack config:

module.exports = {
  // ... 
  module: {
    rules: [
      { test: /\.fsx$/, loader: 'babel-loader!fable-compiler-loader' },
      // or to skip the babel-loader requirement 
      // { test : /\.fsx$/, loader: 'fable-compiler-loader?ecma=es5&module=commonjs' } 
    ]
  }
}

Configuration

Options passed in the loader query will be passed directly to the Fable compiler, with the exception of outDir and watch. The available options are listed here.

Example

Check out the example directory for a simple Hello World example.