DEV Community

Cover image for The Cookbook: Fable
Montana Mendy for Travis CI

Posted on

The Cookbook: Fable

Fable produces readable JavaScript code compatible with ES2015 standards and popular tooling like Webpack, which you've probably heard of if you've ever used React. Let's start this Fable.

Build Fable with Travis CI

Hey builders let's get to building Fable with Travis CI! Let's start out with your .travis.yml file:

language: minimal

services:
  - docker

sudo: required

before_install:
  - docker pull vbfox/fable-build

jobs:
  include:
    - stage: "CI"
      script: docker run -v "${PWD}:/app" -w "/app" vbfox/fable-build bash -c "yarn && yarn postinstall && yarn build"
Enter fullscreen mode Exit fullscreen mode

There's sometimes issues with Fable for whatever reason with syntax errors, so you may want to take the time and lint your .travis.yml file, you can do this via running travis lint.

The package.json

The package.json contains something like the following:

    "scripts": {
    "start": "webpack-dev-server",
    "build": "webpack -p",
    "postinstall": "paket restore && paket generate-load-scripts -f netstandard2.0 -t fsx",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d docs"
  },
Enter fullscreen mode Exit fullscreen mode

As you can see webpack is being triggered there as well. That's it - you've now built Fable in Travis CI! Phew, that was easier than we thought.

Top comments (0)