RSPACK_PROFILE=TRACE=layer=logger rspack build
# filter for an eventRSPACK_PROFILE='TRACE=layer=logger&filter=rspack_core::compiler::compilation' rspack build
# with logger levelRSPACK_PROFILE='TRACE=layer=logger&filter=rspack_core::compiler::compilation=info' rspack build
# filter logs across multiple modulesRSPACK_PROFILE='TRACE=layer=logger&filter=rspack_core::compiler::compilation,rspack_core::build_chunk_graph::code_splitter' rspack build
# [fn_name] will show:# - all functions calls to `fn_name`# - the arguments(except for these in the `skip` list)# - everything until this function returnsRSPACK_PROFILE='TRACE=layer=logger&filter=[build_chunk_graph]' rspack build
# compilation::chunk_asset is a custom instrument nameRSPACK_PROFILE='TRACE=layer=logger&filter=[compilation:chunk_asset]' rspack build
# log a specific function by their argumentsRSPACK_PROFILE='TRACE=layer=logger&filter=[compilation:chunk_asset{filename="main\.js"}]' rspack build
# It support regexp expressionRSPACK_PROFILE='TRACE=layer=logger&filter=[compilation:chunk_asset{filename=".*\.js"}]' rspack build
# disable ansi color escape codesNO_COLOR=1RSPACK_PROFILE=TRACE=layer=logger rspack build
{
"name": "attach:node",
"request": "attach", // refer: https://code.visualstudio.com/docs/editor/debugging#_launch-versus-attach-configurations
"type": "node",
// `9229` is the default port of message
"port": 9229,
}
和 lldb 的 launch 配置
{
"name": "launch:rust-from-node",
"request": "launch",
"type": "lldb", // it means we use `lldb` to launch the binary file of `node`
"program": "node",
"args": [
"--inspect",
"--enable-source-maps",
"${workspaceFolder}/packages/rspack-cli/bin/rspack",
"build",
"-c",
"${workspaceFolder}/examples/basic/rspack.config.js",
],
// `cwd` is just for rspack find the correctly entry.
"cwd": "${workspaceFolder}/examples/basic/",
}