4 ms·
I'm writing for the browser so imports have to be bundled into the final product; I'm not seeing how that will rebuild a.js (depends on b.js) when b.js changes.
by andreareina 9y ago
I'm writing for the browser so imports have to be bundled into the final product; I'm not seeing how that will rebuild a.js (depends on b.js) when b.js changes.
- bigmanwalter 9y agoYou could do something as follows assuming all source files are in src/, your entry point is src/a.js and your output is build/scripts.js. I use browserify for my compilation but this would work similarly with webpack. JS_FILES = $(shell find ./src -name "*.js") JS_ENTRY = ./src/a.js JS_OUT = ./build/scripts.js $(JS_OUT): $(JS_FILES) browserify $(JS_ENTRY) > $(JS_OUT) Now anytime any js files within the src/ directory are modified, make will rebuild scripts.js