Registry / devops / babel-plugin-shopware-vite-meta-glob

babel-plugin-shopware-vite-meta-glob

JSON →
library0.0.5jsnpmunverified

A Babel plugin (v0.0.5, latest stable) that transforms `import.meta.glob()` calls into dynamic module imports for Shopware and Vite-like environments. It supports eager and lazy loading, array patterns, and file path normalization. Notable differentiators: heavily inspired by OpenSourceRaidGuild/babel-vite but handles import meta statements differently; explicitly not recommended for production use due to performance, security, and unexpected behavior risks. Supports Node >=20 and ships TypeScript types. Last release at 0.0.5, release cadence is unknown but appears experimental.

npm install babel-plugin-shopware-vite-meta-glob
INSTALL
IMPORT
SIG · BABEL-PLUGIN-SHOPW
B
babel-plugin-shopware-vite-meta-glob
devopsjavascriptv0.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
No explicit import; add to .babelrc plugins: ['babel-plugin-shopware-vite-meta-glob']
import plugin from 'babel-plugin-shopware-vite-meta-glob' (not needed, config-based)
Babel plugins are configured via string, not imported directly in code.
transform
Not exported; use programmatic API via @babel/core
This plugin is not meant to be imported in user code; it's used by Babel internally.
viteMetaGlob
No such export; use the string name in Babel config
import { viteMetaGlob } from 'babel-plugin-shopware-vite-meta-glob'
The package does not export any symbols; it's a Babel plugin referenced by string.

Demonstrates Babel plugin configuration, input with import.meta.glob, and transformed output with eager loading.

// Install and configure npm install babel-plugin-shopware-vite-meta-glob --save-dev // .babelrc or babel.config.json { "plugins": ["shopware-vite-meta-glob"] } // Input file (e.g., src/modules.js) const modules = import.meta.glob('./components/*.vue', { eager: true }); // After Babel transformation, output will be: const modules = (function () { const __glob__0_0 = require('./components/Button.vue'); const __glob__0_1 = require('./components/Modal.vue'); const __glob__context__ = { './components/Button.vue': __glob__0_0, './components/Modal.vue': __glob__0_1, }; return __glob__context__; })();
Debug
Known issues
gotchaNot recommended for production use due to performance overhead, security risks, and unexpected behavior.
fix
Use the native Vite import.meta.glob if possible. Only use this plugin in development/experimental contexts.
affects: >=0.0.0
gotchaSupports { import: 'default' } only in combination with eager: true; otherwise ignored.
fix
Ensure eager: true when using import: 'default'.
affects: >=0.0.0
gotchaimport.meta.glob with { eager: false } is not transformed; left as-is in output.
fix
Use eager: true or omit the eager option for transformation. eager: false is not supported.
affects: >=0.0.0
gotchaThe query option is ignored and not passed through.
fix
Do not use query: option as it will be dropped.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-shopware-vite-meta-glob'
Plugin not installed or referenced incorrectly in Babel config.
fix
Run 'npm install babel-plugin-shopware-vite-meta-glob --save-dev' and ensure the string 'shopware-vite-meta-glob' is in plugins array.
TypeError: glob.sync is not a function
Outdated glob dependency (v8+) where sync returns a function with newer API.
fix
Downgrade glob to v7 or update plugin (if fix exists). Check package.json for glob version.
The plugin may generate duplicate keys in module object
File paths with different slashes on Windows vs Unix can produce duplicate entries.
fix
Normalize paths manually or ensure consistent slash direction in glob patterns.
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies
@babel/corerequiredrequired peer dependency for any Babel plugin
globrequiredused for file pattern matching
debugoptionalused for logging when DEBUG env var is set
Agent activity
4 hits · last 30 days
node
4
Resources
babel-plugin-shopware-vite-meta-glob — npm install babel-plugin-shopware-vite-meta-glob · libregistry