Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")

### Produce umd and cjs bundles
### Produce umd, cjs and esm bundles

ts_library(
name = "dev",
Expand All @@ -28,6 +28,7 @@ ts_library(
)
for format, args in {
"cjs": [],
"esm": [],
"umd": [
# Downlevel (transpile) to ES5.
"-p",
Expand Down Expand Up @@ -67,6 +68,23 @@ pkg_npm(
],
)

genrule(
name = "incremental-dom-esm",
srcs = [":bundle.esm.js"],
outs = ["dist/incremental-dom-esm.js"],
cmd = "cp $(locations :bundle.esm.js) $@",
)

pkg_npm(
name = "npm-esm",
substitutions = {
"const DEBUG = true;": "const DEBUG = false;",
},
deps = [
":incremental-dom-esm",
],
)

### Produce minified bundle

## Create a second index so that it can have a reference to the release/ directory.
Expand Down Expand Up @@ -131,6 +149,7 @@ pkg_npm(
],
nested_packages = [
":npm-cjs",
":npm-esm",
":npm-min",
":npm-umd",
],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "incremental-dom",
"version": "0.7.0",
"description": "An in-place virtual DOM library",
"exports": "dist/incremental-dom-esm.js",
"main": "dist/incremental-dom-cjs.js",
"author": "The Incremental DOM Authors",
"license": "Apache-2.0",
Expand Down