Skip to content

Commit

Permalink
feat(build): generate package types during build if tsconfig exists
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 5, 2020
1 parent 95bec3c commit e50cc92
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,17 @@ packages-build: packages-types ##@1 packages build all packages
| xargs -I '{}' sh -c '$(MAKE) package-build-{}'

package-types-%: ##@1 packages build a package types
@echo "${YELLOW}Building TypeScript types for package ${WHITE}@nivo/${*}${RESET}"
@-rm -rf ./packages/${*}/dist/types
@-rm -rf ./packages/${*}/dist/tsconfig.tsbuildinfo
@yarn tsc -b ./packages/${*}

package-build-%: ##@1 packages build a package
@if [ -f "./packages/${*}/tsconfig.json" ]; \
then \
echo "${YELLOW}Building TypeScript types for package ${WHITE}@nivo/${*}${RESET}"; \
rm -rf ./packages/${*}/dist/types; \
rm -rf ./packages/${*}/dist/tsconfig.tsbuildinfo; \
yarn tsc -b ./packages/${*}; \
else \
echo "${YELLOW}Package ${WHITE}@nivo/${*}${RESET}${YELLOW} does not have tsconfig, skipping"; \
fi;

package-build-%: package-types-% ##@1 packages build a package
@echo "${YELLOW}Building package ${WHITE}@nivo/${*}${RESET}"
@-rm -rf ./packages/${*}/dist
@export PACKAGE=${*}; NODE_ENV=production BABEL_ENV=production ./node_modules/.bin/rollup -c conf/rollup.config.js
Expand Down

0 comments on commit e50cc92

Please sign in to comment.