vue-inbrowser-compiler-independent-utils is a utility package designed to provide core functionalities for in-browser Vue compilation without requiring a direct runtime dependency on Vue itself. It serves as a foundational layer for other tools within the `vue-styleguidist` ecosystem, such as `vue-docgen-api` and `vue-inbrowser-compiler-utils`, by encapsulating compiler-related tasks like parsing or transformation. This independence allows it to be used in various contexts where full Vue runtime might not be present or desired. The current stable version is 4.71.1, with its release cadence being tightly coupled to the `vue-styleguidist` monorepo, often seeing patch and minor updates driven by Vue compatibility fixes, new feature support, and general improvements across its related packages. Its key differentiator is its isolated nature, ensuring minimal overhead and suitability for environments that only require compiler-adjacent logic.
npm install vue-inbrowser-compiler-independent-utilsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `isCodeVueSfc` to detect Vue SFCs and `compile` to process Vue component code strings into script and style parts suitable for in-browser compilation.
Consult the `vue-styleguidist` GitHub repository for specific migration guides. Changes in Vue's reactivity system (Vue 2 vs Vue 3) or template compilation can often lead to breakage in tools that parse Vue code.
Ensure you understand the role of this package within the `vue-styleguidist` toolchain. For full in-browser compilation and execution of Vue components, you typically need `vue-inbrowser-compiler` itself, which leverages these utilities.
Provide appropriate configuration to the compiler functions, if available, to match your target Vue version. Test compilation thoroughly against your specific Vue runtime environment. Consider using `@vue/compat` for Vue 2 to Vue 3 migrations.
Verify that the input `vueComponentCode` is valid and well-formed. Ensure any configuration passed to `compile` (e.g., `BubleConfig`) is correct and compatible with the code. Log the full output of `compile` to inspect the actual return value.
Do not execute raw Vue component strings directly. Use `isCodeVueSfc` to identify Vue code, and then `compile` it into executable JavaScript. The `script` property of the `compile` output should then be used appropriately, often `new Function(compiledResult.script)()` to get component options.
No dependency data recorded yet.