wip: fix: add context nanoid to avoid confusion in mutiply build in one process #1305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add context nanoid to avoid confusion in mutiply build in one process
Summary by CodeRabbit
compiler.rs
文件中增加了nanoid::nanoid
的引入,并在Context
和Compiler
结构体中增加了类型为String
的nanoid
字段,初始化为nanoid!(6)
。ast_impl.rs
文件的render_css_chunk
、render_normal_js_chunk
和render_entry_chunk_js_without_full_hash
函数中更新了convert
字段,包含了context.id
在格式化中的应用。str_impl.rs
文件的render_entry_js_chunk
和emit_module_with_mapping
函数中,更新了convert
函数,将context.id
包含在格式化字符串中。optimize_package_imports.rs
文件的build_import_stmts
函数中,修改了与构建导入语句相关的函数的缓存转换逻辑,现在在转换过程中包含了上下文标识符。