Skip to content

Instantly share code, notes, and snippets.

@jmsdncn

jmsdncn/BUILD Secret

Last active February 1, 2019 07:01
Show Gist options
  • Save jmsdncn/8e21f5842acb51eb131bc9fc8605a22a to your computer and use it in GitHub Desktop.
Save jmsdncn/8e21f5842acb51eb131bc9fc8605a22a to your computer and use it in GitHub Desktop.
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
ts_library(
name = "lib",
srcs = ["lib.ts"],
deps = ["@npm//lit-html"],
)
load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle")
rollup_bundle(
name = "bundle",
entry_point = "lib.js",
deps = [":lib"],
)
rollup_bundle(
name = "bundle_with_modules",
entry_point = "lib.js",
node_modules = "@npm//:node_modules",
deps = [":lib"],
)
rollup_bundle(
name = "bundle_with_dep",
entry_point = "lib.js",
deps = [
":lib",
"@npm//lit-html",
],
)
import { nothing } from 'lit-html'
console.log(nothing)
{
"devDependencies": {
"@bazel/typescript": "^0.22.1",
"lit-html": "^1.0.0-rc.2",
"typescript": "^3.3.1"
}
}
workspace(name = "demo")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "build_bazel_rules_typescript",
remote = "https://github.com/bazelbuild/rules_typescript.git",
tag = "0.22.1",
)
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
rules_typescript_dependencies()
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
rules_nodejs_dependencies()
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
ts_setup_workspace()
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
node_repositories(package_json = ["//:package.json"])
yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment