Git Product home page Git Product logo

bazel-ts-example's Introduction

Bazel TypeScript Examples

Examples demonstrate building TypeScript with Bazel.

Bazel TypeScript NodeJs Yarn

Build

Run bazel query ... to see all available labels.

Run yarn serve to start local dev server with live reload.

Run yarn stat to see file statistic of the repo. It will print number of each file extension.

Setup buidifier

There's a tool from the official buildtool repo called buildifier that can format our bazel files.

  1. Install the bazel VSCode extension
  2. Clone buildtools
  3. Run bazel //buildifier:buildifier to build the buildifier.
  4. Set the path for the buildifier generated from above step in VSCode user setting "bazel.buildifierPath": "private/var/tmp/_bazel_wayou/308cd286b0587bcdbdec05695018ee18/execroot/com_github_bazelbuild_buildtools/bazel-out/darwin-fastbuild/bin/buildifier/darwin_amd64_stripped/buildifier"
  5. Enable "editor.formatOnSave": true

Troubleshooting

  • If all types are discovered then all types need to be included as deps or typescript may error like TS2688: Cannot find type definition file for 'foo'.
  • If you move the location of a ts_devserver target and try start the server again you may get error that the bazel says cannot load /the/original/path/of/the/server/MF/file. Just run bazel clean --expunge and try rebuild againa. If that's still not work, try change a port for the server and start again.

bazel-ts-example's People

Contributors

wayou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.