-
-
Save jmsdncn/8e21f5842acb51eb131bc9fc8605a22a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
], | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { nothing } from 'lit-html' | |
console.log(nothing) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"@bazel/typescript": "^0.22.1", | |
"lit-html": "^1.0.0-rc.2", | |
"typescript": "^3.3.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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