some code disappeared when build project #7541
Labels
bug: upstream
Bug in a dependency of Vite
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
i use
@elastic/apm-rum-vue
, and use its export functionApmVuePlugin
and then i build project
but the function
patchEventTarget
in file namedevent-target-patch.js
is not build into the dist file.source file in
@elastic/apm-rum-core/dist/es/common/patching/index.js
dist file
index.xxxxxx.js
(build.minify =false
)but when i add a
console.log()
, build it again and functionpatchEventTarget
is exist in dist file...add
console.log
in@elastic/apm-rum-core/dist/es/common/patching/index.js
or add
console.log
in@elastic/apm-rum-core/dist/es/common/patching/event-target-patch.js
last i set the build.rollupOptions.treeshake = false to solve problem.
it seems that function
patchEventTarget
is regarded as something which can be treeshake...Reproduction
https://github.com/Dedicatus546/vite-build-lack-code-demo
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: