From 05142b0f79960cc52ac76e843cad71175a63e555 Mon Sep 17 00:00:00 2001 From: Charlie Ruan <53290280+CharlieFRuan@users.noreply.github.com> Date: Wed, 22 May 2024 18:49:00 -0400 Subject: [PATCH] [Fix][Vite] Fix error for index.js.map --- cleanup-index-js.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup-index-js.sh b/cleanup-index-js.sh index a1700034..8914b38e 100755 --- a/cleanup-index-js.sh +++ b/cleanup-index-js.sh @@ -15,7 +15,7 @@ sed -e s/"new (require('u' + 'rl').URL)('file:' + __filename).href"/"\"MLC_DUMMY # For more see https://github.com/mlc-ai/web-llm/issues/258 and https://github.com/mlc-ai/web-llm/issues/127 sed -e s/"import require\$\$3 from 'perf_hooks';"/"const require\$\$3 = \"MLC_DUMMY_REQUIRE_VAR\""/g -i .backup lib/index.js # Similarly replace `const performanceNode = require(\"perf_hooks\")` with `const performanceNode = "MLC_DUMMY_REQUIRE_VAR"` -sed -e s/'require(\\\"perf_hooks\\\")'/'\"MLC_DUMMY_REQUIRE_VAR\"'/g -i .backup lib/index.js.map +sed -e s/'require(\\\"perf_hooks\\\")'/'\\\"MLC_DUMMY_REQUIRE_VAR\\\"'/g -i .backup lib/index.js.map # Cleanup backup files rm lib/index.js.backup