Created
May 14, 2020 14:48
-
-
Save wordijp/853323f64ff7cdacabf862a14c40b9f9 to your computer and use it in GitHub Desktop.
deno example by Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lib/foo.js | |
export default function() { | |
console.log('foo.js'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lib/hoge/piyo.ts | |
export default function() { | |
console.log('piyo.ts modified'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main.js | |
import foo from 'http://localhost:8000/lib/foo.js'; | |
import piyo from 'http://localhost:8000/lib/hoge/piyo.ts'; | |
foo(); | |
piyo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make | |
rwildcard=$(foreach d,$(wildcard $(1:=/*)), \ | |
$(call rwildcard,$d,$2) \ | |
$(filter $(subst *,%,$2),$d)) | |
# http://www.jsk.t.u-tokyo.ac.jp/~k-okada/makefile/ | |
empty:= | |
space:= $(empty) $(empty) | |
myjoin=$(subst $(space),$2,$1) | |
# -------------------------------------------------- | |
LOCAL_ROOT = http://localhost:8000/ | |
MAIN_SRC = main.js | |
LIB_SRCS = $(call rwildcard,lib,*.js *.ts) | |
LIB_SRCS := $(patsubst %, $(LOCAL_ROOT)%, $(LIB_SRCS)) | |
LIB_SRCS := $(strip $(LIB_SRCS)) | |
comma:= , | |
LIB_SRCS := $(call myjoin,$(LIB_SRCS),$(comma)) | |
# -------------------------------------------------- | |
deno: | |
deno run --reload=$(LIB_SRCS) $(MAIN_SRC) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
launch local server command example:
python -m http.server