blob: 9f619683ef4cb8f2bab432493db155a0b98f5b40 [file] [log] [blame]
load("//infra-sk:index.bzl", "copy_file_from_npm_pkg", "sk_page")
CANVAKIT_FILES = [
{
"src": "//skottie/wasm_libs:canvaskit.js",
"dst": "canvaskit.js",
},
{
"src": "//skottie/wasm_libs:version.js",
"dst": "version.js",
},
{
"src": "//skottie/wasm_libs:canvaskit.wasm",
"dst": "canvaskit.wasm",
},
]
sk_page(
name = "drive",
assets_serving_path = "/static",
html_file = "drive.html",
scss_entry_point = "drive.scss",
sk_element_deps = ["//skottie/modules/skottie-drive-sk"],
ts_entry_point = "drive.ts",
)
sk_page(
name = "embed",
assets_serving_path = "/static",
html_file = "embed.html",
scss_entry_point = "embed.scss",
sk_element_deps = ["//skottie/modules/skottie-embed-sk"],
ts_entry_point = "embed.ts",
)
# Under rules_js (https://github.com/aspect-build/rules_js), we cannot refer to files inside NPM
# packages directly. Instead, we must create local copies of those files. See the
# copy_file_from_npm_pkg macro documentation for details.
copy_file_from_npm_pkg(
name = "ffmpeg_core_js",
src = "dist/ffmpeg-core.js",
out = "ffmpeg-core.js",
npm_package_name = "@ffmpeg/core",
)
copy_file_from_npm_pkg(
name = "ffmpeg_core_wasm",
src = "dist/ffmpeg-core.wasm",
out = "ffmpeg-core.wasm",
npm_package_name = "@ffmpeg/core",
)
copy_file_from_npm_pkg(
name = "ffmpeg_core_worker_js",
src = "dist/ffmpeg-core.worker.js",
out = "ffmpeg-core.worker.js",
npm_package_name = "@ffmpeg/core",
)
copy_file_from_npm_pkg(
name = "jsoneditor_icons_svg",
src = "dist/img/jsoneditor-icons.svg",
out = "jsoneditor-icons.svg",
npm_package_name = "jsoneditor",
)
sk_page(
name = "index",
assets_serving_path = "/static",
# Note: If we try to set these files more than once (e.g. on the other pages), then the
# page cannot build because there are duplicate entries for the same output files. Thus, we
# only specify them once on the index page.
copy_files = CANVAKIT_FILES + [
{
"src": "//skottie/modules/skottie-gif-exporter-sk:gif_js",
"dst": "gif.js",
},
{
"src": "//skottie/modules/skottie-gif-exporter-sk:gif_worker_js",
"dst": "gif.worker.js",
},
{
"src": "jsoneditor-icons.svg",
"dst": "img/jsoneditor-icons.svg",
},
{
"src": "//skottie/modules/skottie-inline-sk:bundle",
"dst": "inline-bundle.js",
},
{
"src": "//skottie/assets:checkerboard",
"dst": "checker.png",
},
{
"src": "ffmpeg-core.js",
"dst": "ffmpeg-core.js",
},
{
"src": "ffmpeg-core.wasm",
"dst": "ffmpeg-core.wasm",
},
{
"src": "ffmpeg-core.worker.js",
"dst": "ffmpeg-core.worker.js",
},
],
html_file = "index.html",
scss_entry_point = "index.scss",
sk_element_deps = ["//skottie/modules/skottie-sk"],
ts_entry_point = "index.ts",
)