ts_next.conf 2.3 KB

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