buildWithWorkspaceLibs
Package: @autotracer/plugin-vite-react18 · Layer: Build · Type: boolean · Default: false
buildWithWorkspaceLibs is a build configuration option for reactTracer.vite() — the Vite plugin initializer of the @autotracer/plugin-vite-react18 React build-time injection package. It enables the plugin's special UMD/global loading path for production builds.
When this option is true and inject is enabled, the plugin:
- externalizes
@autotracer/react18,react, andreact-domfrom the whole build - injects
<script>tags that load React, ReactDOM, and the emitted ReactTracer UMD bundle before the app bundle - emits
auto-tracer-react18.umd.jsas a build asset
This option affects vite build only. Dev mode is unchanged.
Because it removes React from the app bundle and relies on injected UMD globals, most projects should leave this off. Use it only when you intentionally want that tradeoff. If you are deciding between this option and other workspace wiring strategies, read the Monorepo Guide first.
Read together with reactUmdSrc, reactDomUmdSrc, and inject.
Usage
reactTracer.vite({
inject: isInternalBuild,
buildWithWorkspaceLibs: isInternalBuild,
});