1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- # 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 \
- && $ADD_VCS_INFO_FILE_CMD \
- && ${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} \
- --vcs-info "${VCS_INFO_FILE}" --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.
- ### Build results are packed as `output.tar`.
- ###
- ### @example
- ###
- ### TS_BUNDLE()
- ### SRCS(src/index.ts)
- ### END()
- ###
- multimodule TS_BUNDLE {
- module BUILD: _TS_BASE_UNIT {
- .CMD=TS_BUNDLE_WEBPACK
- .PEERDIRSELF=NODE_MODULES
- # epilogue is not inherited from TS_LIBRARY
- .EPILOGUE=_TS_CONFIG_EPILOGUE
- # by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
- # but we have to set it to TS for include processor to work
- SET(MODULE_TAG TS)
- _PEERDIR_TS_RESOURCE(webpack)
- SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/${TS_CONFIG_PATH} ${CURDIR}/package.json)
- SET(TS_CONFIG_DEDUCE_OUT no)
- _TS_CONFIGURE($TS_CONFIG_PATH)
- # we should set NODE_MODULES_BUNDLE_AS_OUTPUT conditionally,
- # based on whether module has deps or doesn't have
- _SET_NODE_MODULES_BUNDLE_AS_OUTPUT()
- }
- module NODE_MODULES: _NODE_MODULES_BASE {
- }
- }
|