ts_next.conf 1.9 KB

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