Skip to content

Commit

Permalink
🔨 Replace node:* with * using sed in the output JS file
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeta611 committed Jan 31, 2025
1 parent 48987d5 commit 3c39f18
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
DUNE=dune
ESBUILD=bunx esbuild
SED=sed
TARGET_JS=./_build/default/bin/js/main.bc.js
OUTPUT_JS=./react-trace.bc.js

ESBUILD_FLAGS=--outfile=$(OUTPUT_JS) --bundle --platform=browser \
--external:node:child_process --external:node:tty \
--external:node:constants --minify --target=es2020

all: $(OUTPUT_JS)

$(TARGET_JS):
$(DUNE) build --profile=prod

$(OUTPUT_JS): $(TARGET_JS)
$(ESBUILD) $(TARGET_JS) $(ESBUILD_FLAGS)
$(SED) 's/node://g' $(TARGET_JS) >$(OUTPUT_JS)

clean:
$(DUNE) clean
rm -f $(OUTPUT_JS)

rebuild: clean all
Expand Down

0 comments on commit 3c39f18

Please sign in to comment.