ts_next.conf 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. .PEERDIRSELF=TS_PREPARE_DEPS
  29. # by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
  30. # but we have to set it to TS for include processor to work
  31. SET(MODULE_TAG TS)
  32. _PEERDIR_TS_RESOURCE(next)
  33. DISABLE(TS_CONFIG_DEDUCE_OUT)
  34. DISABLE(TS_CONFIG_USE_OUTDIR)
  35. _TS_CONFIGURE($TS_CONFIG_PATH)
  36. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
  37. _TS_ADD_NODE_MODULES_FOR_BUILDER()
  38. }
  39. module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
  40. }
  41. }
  42. macro TS_NEXT_CONFIG(Path) {
  43. SET(TS_NEXT_CONFIG_PATH $Path)
  44. }
  45. ### @usage: TS_NEXT_OUTPUT(DirName)
  46. ###
  47. ### Macro sets the output directory name for TS_NEXT module.
  48. ###
  49. ### - DirName - output directory name ("bundle" by default).
  50. macro TS_NEXT_OUTPUT(DirName) {
  51. SET(TS_NEXT_OUTPUT_DIR $DirName)
  52. }