Add CommonJS bundle for MediaPipe Tasks
Fixes https://github.com/google/mediapipe/issues/4398 PiperOrigin-RevId: 538539711
This commit is contained in:
parent
489e927410
commit
a7cd7b9a32
|
@ -43,7 +43,23 @@ rollup_bundle(
|
||||||
entry_point = "index.ts",
|
entry_point = "index.ts",
|
||||||
format = "esm",
|
format = "esm",
|
||||||
output_dir = False,
|
output_dir = False,
|
||||||
sourcemap = "false",
|
sourcemap = "true",
|
||||||
|
deps = [
|
||||||
|
":audio_lib",
|
||||||
|
"@npm//@rollup/plugin-commonjs",
|
||||||
|
"@npm//@rollup/plugin-node-resolve",
|
||||||
|
"@npm//@rollup/plugin-terser",
|
||||||
|
"@npm//google-protobuf",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
rollup_bundle(
|
||||||
|
name = "audio_bundle_cjs",
|
||||||
|
config_file = "//mediapipe/tasks/web:rollup.config.mjs",
|
||||||
|
entry_point = "index.ts",
|
||||||
|
format = "cjs",
|
||||||
|
output_dir = False,
|
||||||
|
sourcemap = "true",
|
||||||
deps = [
|
deps = [
|
||||||
":audio_lib",
|
":audio_lib",
|
||||||
"@npm//@rollup/plugin-commonjs",
|
"@npm//@rollup/plugin-commonjs",
|
||||||
|
@ -76,6 +92,7 @@ pkg_npm(
|
||||||
"wasm/audio_wasm_nosimd_internal.js",
|
"wasm/audio_wasm_nosimd_internal.js",
|
||||||
"wasm/audio_wasm_nosimd_internal.wasm",
|
"wasm/audio_wasm_nosimd_internal.wasm",
|
||||||
":audio_bundle",
|
":audio_bundle",
|
||||||
|
":audio_bundle_cjs",
|
||||||
":package_json",
|
":package_json",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
"name": "@mediapipe/tasks-__NAME__",
|
"name": "@mediapipe/tasks-__NAME__",
|
||||||
"version": "__VERSION__",
|
"version": "__VERSION__",
|
||||||
"description": "__DESCRIPTION__",
|
"description": "__DESCRIPTION__",
|
||||||
"main": "__NAME___bundle.js",
|
"main": "__NAME___bundle_cjs.js",
|
||||||
|
"browser": "__NAME___bundle.js",
|
||||||
|
"module": "__NAME___bundle.js",
|
||||||
"author": "mediapipe@google.com",
|
"author": "mediapipe@google.com",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"types": "__TYPES__",
|
"types": "__TYPES__",
|
||||||
|
|
|
@ -44,7 +44,23 @@ rollup_bundle(
|
||||||
entry_point = "index.ts",
|
entry_point = "index.ts",
|
||||||
format = "esm",
|
format = "esm",
|
||||||
output_dir = False,
|
output_dir = False,
|
||||||
sourcemap = "false",
|
sourcemap = "true",
|
||||||
|
deps = [
|
||||||
|
":text_lib",
|
||||||
|
"@npm//@rollup/plugin-commonjs",
|
||||||
|
"@npm//@rollup/plugin-node-resolve",
|
||||||
|
"@npm//@rollup/plugin-terser",
|
||||||
|
"@npm//google-protobuf",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
rollup_bundle(
|
||||||
|
name = "text_bundle_cjs",
|
||||||
|
config_file = "//mediapipe/tasks/web:rollup.config.mjs",
|
||||||
|
entry_point = "index.ts",
|
||||||
|
format = "cjs",
|
||||||
|
output_dir = False,
|
||||||
|
sourcemap = "true",
|
||||||
deps = [
|
deps = [
|
||||||
":text_lib",
|
":text_lib",
|
||||||
"@npm//@rollup/plugin-commonjs",
|
"@npm//@rollup/plugin-commonjs",
|
||||||
|
@ -78,5 +94,6 @@ pkg_npm(
|
||||||
"wasm/text_wasm_nosimd_internal.wasm",
|
"wasm/text_wasm_nosimd_internal.wasm",
|
||||||
":package_json",
|
":package_json",
|
||||||
":text_bundle",
|
":text_bundle",
|
||||||
|
":text_bundle_cjs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -55,7 +55,23 @@ rollup_bundle(
|
||||||
entry_point = "index.ts",
|
entry_point = "index.ts",
|
||||||
format = "esm",
|
format = "esm",
|
||||||
output_dir = False,
|
output_dir = False,
|
||||||
sourcemap = "false",
|
sourcemap = "true",
|
||||||
|
deps = [
|
||||||
|
":vision_lib",
|
||||||
|
"@npm//@rollup/plugin-commonjs",
|
||||||
|
"@npm//@rollup/plugin-node-resolve",
|
||||||
|
"@npm//@rollup/plugin-terser",
|
||||||
|
"@npm//google-protobuf",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
rollup_bundle(
|
||||||
|
name = "vision_bundle_cjs",
|
||||||
|
config_file = "//mediapipe/tasks/web:rollup.config.mjs",
|
||||||
|
entry_point = "index.ts",
|
||||||
|
format = "cjs",
|
||||||
|
output_dir = False,
|
||||||
|
sourcemap = "true",
|
||||||
deps = [
|
deps = [
|
||||||
":vision_lib",
|
":vision_lib",
|
||||||
"@npm//@rollup/plugin-commonjs",
|
"@npm//@rollup/plugin-commonjs",
|
||||||
|
@ -89,5 +105,6 @@ pkg_npm(
|
||||||
"wasm/vision_wasm_nosimd_internal.wasm",
|
"wasm/vision_wasm_nosimd_internal.wasm",
|
||||||
":package_json",
|
":package_json",
|
||||||
":vision_bundle",
|
":vision_bundle",
|
||||||
|
":vision_bundle_cjs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user