2.1.9 • Published 4 years ago

fable-loader v2.1.9

Weekly downloads
1,006
License
MIT
Repository
github
Last release
4 years ago

fable-loader

Webpack loader for Fable (F# to JS compiler)

Installation

npm install fable-loader fable-compiler @babel/core

Usage

Create a webpack-config.js like the following and run it using Webpack (e.g. npx webpack).

ATTENTION: In Fable 2.0 you had to call Webpack through the dotnet-fable CLI tool, starting from Fable 2.1 you call Webpack directly. For example, if you used the command dotnet fable webpack -- --config src/webpack.config.js, replace it with npx webpack --config src/webpack.config.js (you can also use yarn instead of npx). Note you don't need the -- separator anymore.

NOTE: The actual F# to JS compilation is done by fable-compiler. You can control the compiler version through this package.

See the Fable webpack-config-template for a more comprehensive example of a Webpack configuration for Fable projects.

var path = require("path");

module.exports = {
    mode: "production",
    entry: "./src/App.fsproj",
    output: {
        path: path.join(__dirname, "./public"),
        filename: "bundle.js",
    },
    devServer: {
        contentBase: "./public",
        port: 8080,
    },
    module: {
        rules: [{
            test: /\.fs(x|proj)?$/,
            use: "fable-loader"
        }]
    }
}

Options

These are the options that can be passed to fable-loader:

  • babel: Babel options (only applied when transforming F# files, you may want to use the babel-loader if you also have JS files in your project).
  • define: Array of compilation constants passed to the F# compiler. Fable automatically defines FABLE_COMPILER and fable-loader will also define DEBUG in Webpack "development" mode.
  • typedArrays: Translate numeric arrays as JS Typed Arrays. True by default.
  • clampByteArrays: If true, Fable will translate byte arrays as Uint8ClampedArray.
  • silent: If true, Fable won't output any log (requires fable-compiler >=2.3.14).
2.1.9

4 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.1.0-beta-007

5 years ago

2.1.0-beta-006

5 years ago

2.1.0-beta-005

5 years ago

2.1.0-beta-004

5 years ago

2.1.0-beta-003

5 years ago

2.1.0-beta-001

5 years ago

2.0.0

6 years ago

2.0.0-beta-001

6 years ago

2.0.0-alpha-003

6 years ago

2.0.0-alpha-002

6 years ago

2.0.0-alpha-001

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-narumi-914

7 years ago

1.0.0-narumi-912

7 years ago

1.0.0-narumi-911

7 years ago

1.0.0-narumi-910

7 years ago

1.0.0-narumi-909

7 years ago

1.0.0-narumi-908

7 years ago

1.0.0-narumi-907

7 years ago

1.0.0-narumi-906

7 years ago

1.0.0-narumi-905

7 years ago

1.0.0-narumi-16

7 years ago

1.0.0-narumi-15

7 years ago

1.0.0-narumi-9

7 years ago

1.0.0-narumi-8

7 years ago

1.0.0-narumi-6

7 years ago

1.0.0-narumi-4

7 years ago

1.0.0-narumi-1

7 years ago