ts_next.conf 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. TS_NEXT_OUTPUT_DIR=.next
  2. TS_NEXT_CONFIG_PATH=next.config.js
  3. TS_NEXT_CMD=$TOUCH_UNIT \
  4. && $_TS_FILES_COPY_CMD \
  5. && $ADD_VCS_INFO_FILE_CMD \
  6. && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS build-next $NOTS_TOOL_COMMON_BUILDER_ARGS \
  7. --bundler-config-path ${input:TS_NEXT_CONFIG_PATH} \
  8. --output-dir ${TS_NEXT_OUTPUT_DIR} \
  9. $_NODE_MODULES_INOUTS ${hide:PEERS} \
  10. ${input;hide:"package.json"} ${TS_CONFIG_FILES} $_AS_HIDDEN_INPUTS(IN $TS_INPUT_FILES) \
  11. ${output;hide:"package.json"} \
  12. ${kv;hide:"pc magenta"} ${kv;hide:"p TS_NXT"}
  13. ### @usage: TS_NEXT()
  14. ###
  15. ### NextJS app, built with `next build`. Requires sources to be under /src folder.
  16. ### /pages and /app on the root level ar not supported.
  17. ### Build results are output.tar.
  18. ###
  19. ### @example
  20. ###
  21. ### TS_NEXT()
  22. ### END()
  23. ###
  24. multimodule TS_NEXT {
  25. module BUILD: _TS_BASE_UNIT {
  26. .CMD=TS_NEXT_CMD
  27. .EPILOGUE=_TS_CONFIG_EPILOGUE
  28. # by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
  29. # but we have to set it to TS for include processor to work
  30. SET(MODULE_TAG TS)
  31. _PEERDIR_TS_RESOURCE(next)
  32. DISABLE(TS_CONFIG_DEDUCE_OUT)
  33. DISABLE(TS_CONFIG_USE_OUTDIR)
  34. _TS_CONFIGURE($TS_CONFIG_PATH)
  35. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
  36. _TS_ADD_NODE_MODULES_FOR_BUILDER()
  37. }
  38. }
  39. macro TS_NEXT_CONFIG(Path) {
  40. SET(TS_NEXT_CONFIG_PATH $Path)
  41. }
  42. ### @usage: TS_NEXT_OUTPUT(DirName)
  43. ###
  44. ### Macro sets the output directory name for TS_NEXT module.
  45. ###
  46. ### - DirName - output directory name ("bundle" by default).
  47. macro TS_NEXT_OUTPUT(DirName) {
  48. SET(TS_NEXT_OUTPUT_DIR $DirName)
  49. }