A JavaScript Build Adventure Story

An Adventure

JavaScript development and build systems feels like a “choose your own adventure” book.

Yarn, NPM, Rollup, Webpack, et al fail to track dependencies and force sloppy chaining of plugins and scripts to accomplish something that should be much more transparent.

A Deterministic, Cached Adventure

plugins: [
typescript(),
babel(babelOptions),
],
rollup_bundle(
name = "app",
srcs = [":index.js"],
entry_point = "index.js",
config_file = "//:rollup.config.js",
format = "iife",
)
babel(
name = "transpiled",
args = [
"$(location :app)",
"--out-file",
"$@/transpiled.js",
],
data = [
":app.js",
"@npm//@babel/preset-env",
"//:babel.config.json",
],
outs = ["transpiled.js"],
)
prettier(
src = ":index.html",
out = "pretty.html",
)

Bazel Disclaimer

--

--

Now writing at: https://justin.poehnelt.com — Senior Developer Relations Engineer @google

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store