{"id":19163,"library":"babel-plugin-shopware-vite-meta-glob","title":"Babel Plugin Shopware Vite Meta Glob","description":"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.","status":"active","version":"0.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/shopware/babel-plugin-shopware-vite-meta-glob","tags":["javascript","typescript"],"install":[{"cmd":"npm install babel-plugin-shopware-vite-meta-glob","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-shopware-vite-meta-glob","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-shopware-vite-meta-glob","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required peer dependency for any Babel plugin","package":"@babel/core","optional":false},{"reason":"used for file pattern matching","package":"glob","optional":false},{"reason":"used for logging when DEBUG env var is set","package":"debug","optional":true}],"imports":[{"note":"Babel plugins are configured via string, not imported directly in code.","wrong":"import plugin from 'babel-plugin-shopware-vite-meta-glob' (not needed, config-based)","symbol":"default","correct":"No explicit import; add to .babelrc plugins: ['babel-plugin-shopware-vite-meta-glob']"},{"note":"This plugin is not meant to be imported in user code; it's used by Babel internally.","symbol":"transform","correct":"Not exported; use programmatic API via @babel/core"},{"note":"The package does not export any symbols; it's a Babel plugin referenced by string.","wrong":"import { viteMetaGlob } from 'babel-plugin-shopware-vite-meta-glob'","symbol":"viteMetaGlob","correct":"No such export; use the string name in Babel config"}],"quickstart":{"code":"// Install and configure\nnpm install babel-plugin-shopware-vite-meta-glob --save-dev\n\n// .babelrc or babel.config.json\n{\n  \"plugins\": [\"shopware-vite-meta-glob\"]\n}\n\n// Input file (e.g., src/modules.js)\nconst modules = import.meta.glob('./components/*.vue', { eager: true });\n\n// After Babel transformation, output will be:\nconst modules = (function () {\n  const __glob__0_0 = require('./components/Button.vue');\n  const __glob__0_1 = require('./components/Modal.vue');\n  const __glob__context__ = {\n    './components/Button.vue': __glob__0_0,\n    './components/Modal.vue': __glob__0_1,\n  };\n  return __glob__context__;\n})();\n","lang":"javascript","description":"Demonstrates Babel plugin configuration, input with import.meta.glob, and transformed output with eager loading."},"warnings":[{"fix":"Use the native Vite import.meta.glob if possible. Only use this plugin in development/experimental contexts.","message":"Not recommended for production use due to performance overhead, security risks, and unexpected behavior.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure eager: true when using import: 'default'.","message":"Supports { import: 'default' } only in combination with eager: true; otherwise ignored.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use eager: true or omit the eager option for transformation. eager: false is not supported.","message":"import.meta.glob with { eager: false } is not transformed; left as-is in output.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Do not use query: option as it will be dropped.","message":"The query option is ignored and not passed through.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install babel-plugin-shopware-vite-meta-glob --save-dev' and ensure the string 'shopware-vite-meta-glob' is in plugins array.","cause":"Plugin not installed or referenced incorrectly in Babel config.","error":"Error: Cannot find module 'babel-plugin-shopware-vite-meta-glob'"},{"fix":"Downgrade glob to v7 or update plugin (if fix exists). Check package.json for glob version.","cause":"Outdated glob dependency (v8+) where sync returns a function with newer API.","error":"TypeError: glob.sync is not a function"},{"fix":"Normalize paths manually or ensure consistent slash direction in glob patterns.","cause":"File paths with different slashes on Windows vs Unix can produce duplicate entries.","error":"The plugin may generate duplicate keys in module object"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}