diff options
author | vturov <vturov@yandex-team.com> | 2023-06-27 11:53:24 +0300 |
---|---|---|
committer | vturov <vturov@yandex-team.com> | 2023-06-27 11:53:24 +0300 |
commit | 5a92e94875413808828580bb1339531e52c17206 (patch) | |
tree | 8aae63fd7a81ae52e524491975ad9620b7e74802 /build/conf/ts | |
parent | bbdc1aa5e9b3ed5f117eae9c6cc929c6cacc3386 (diff) | |
download | ydb-5a92e94875413808828580bb1339531e52c17206.tar.gz |
custom output directory name for TS_BUNDLE / TS_NEXT
Добавляем возможность указывать кастомную выходную директорию для TS_BUNDLE и TS_NEXT (`bundle` по умолчанию).
Diffstat (limited to 'build/conf/ts')
-rw-r--r-- | build/conf/ts/ts_bundle.conf | 12 | ||||
-rw-r--r-- | build/conf/ts/ts_next.conf | 15 |
2 files changed, 24 insertions, 3 deletions
diff --git a/build/conf/ts/ts_bundle.conf b/build/conf/ts/ts_bundle.conf index 0712a83339..de6acc360e 100644 --- a/build/conf/ts/ts_bundle.conf +++ b/build/conf/ts/ts_bundle.conf @@ -1,13 +1,25 @@ # WEBPACK_ROOT is defined by _PEERDIR_TS_RESOURCE(webpack) WEBPACK_ROOT= +WEBPACK_OUTPUT_DIR=bundle WEBPACK_CONFIG_PATH=webpack.config.js + TS_BUNDLE_WEBPACK=$TOUCH_UNIT \ && ${cwd:BINDIR} $NOTS_TOOL bundle-webpack $NOTS_TOOL_BASE_ARGS --webpack-resource $WEBPACK_ROOT \ --moddir $MODDIR --webpack-config ${input:WEBPACK_CONFIG_PATH} --ts-config ${input:TS_CONFIG_PATH} \ + --output-dir ${WEBPACK_OUTPUT_DIR} \ --node-modules-bundle $NOTS_TOOL_NODE_MODULES_BUNDLE $NODE_MODULES_BUNDLE_AS_OUTPUT ${hide:PEERS} \ ${input;hide:"./package.json"} ${TS_CONFIG_FILES} ${output;hide:"output.tar"} \ ${output;hide:"package.json"} ${kv;hide:"p TSWP"} ${kv;hide:"pc magenta"} +### @usage: WEBPACK_OUTPUT(DirName) +### +### Macro sets the output directory name for TS_BUNDLE module. +### +### - DirName - output directory name ("bundle" by default). +macro WEBPACK_OUTPUT(DirName) { + SET(WEBPACK_OUTPUT_DIR $DirName) +} + ### @usage: TS_BUNDLE([name]) ### ### The Webpack bundle, bundles JavaScript code. diff --git a/build/conf/ts/ts_next.conf b/build/conf/ts/ts_next.conf index 5117dab2bb..d681160460 100644 --- a/build/conf/ts/ts_next.conf +++ b/build/conf/ts/ts_next.conf @@ -1,22 +1,23 @@ # NEXT_ROOT is defined by _PEERDIR_TS_RESOURCE(next) NEXT_ROOT= +TS_NEXT_OUTPUT_DIR=bundle TS_NEXT_CONFIG_PATH=next.config.js TS_NEXT_SRC_FILES= - TS_NEXT_CMD=$TOUCH_UNIT \ && ${cwd:BINDIR} $NOTS_TOOL build-nextjs $NOTS_TOOL_BASE_ARGS \ --moddir $MODDIR --nextjs-resource $NEXT_ROOT \ --nextjs-config ${input:TS_NEXT_CONFIG_PATH} --ts-config ${input:TS_CONFIG_PATH} \ + --output-dir ${TS_NEXT_OUTPUT_DIR} \ --node-modules-bundle $NOTS_TOOL_NODE_MODULES_BUNDLE $NODE_MODULES_BUNDLE_AS_OUTPUT ${hide:PEERS} \ - ${input;hide:"./package.json"} ${TS_CONFIG_FILES} ${output;hide:"bundle.tar"} \ + ${input;hide:"./package.json"} ${TS_CONFIG_FILES} ${output;hide:"output.tar"} \ ${output;hide:"package.json"} ${kv;hide:"p TSNEXT"} ${kv;hide:"pc magenta"} ### @usage: TS_NEXT() ### ### NextJS app, built with `next build`. Requires sources to be under /src folder. ### /pages and /app on the root level ar not supported. -### Build results are bundle.tar. +### Build results are output.tar. ### ### @example ### @@ -59,3 +60,11 @@ macro _TS_NEXT_EPILOG() { SRCS($TS_NEXT_SRC_FILES) } +### @usage: TS_NEXT_OUTPUT(DirName) +### +### Macro sets the output directory name for TS_NEXT module. +### +### - DirName - output directory name ("bundle" by default). +macro TS_NEXT_OUTPUT(DirName) { + SET(TS_NEXT_OUTPUT_DIR $DirName) +} |