{"id":19170,"library":"babel-plugin-strip-glimmer-utils","title":"babel-plugin-strip-glimmer-utils","description":"A Babel plugin that strips specific imports and usages from @glimmer/utils (e.g., unwrap, expect) in production builds. Version 0.1.1 is the latest. Designed for Ember/Glimmer applications to remove debug-only utility calls. Lightweight, no runtime dependencies. Alternative to manual tree-shaking.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","babel-plugin"],"install":[{"cmd":"npm install babel-plugin-strip-glimmer-utils","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-strip-glimmer-utils","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-strip-glimmer-utils","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency to function as a Babel plugin.","package":"@babel/core","optional":true}],"imports":[{"note":"Plugin is exported as default. Named export may lead to undefined.","wrong":"import { stripGlimmerUtils } from 'babel-plugin-strip-glimmer-utils'","symbol":"default export (plugin)","correct":"import stripGlimmerUtils from 'babel-plugin-strip-glimmer-utils'"},{"note":"Must provide configuration object with source and bindings.","wrong":"plugins: ['babel-plugin-strip-glimmer-utils']","symbol":"plugin usage in Babel config","correct":"plugins: [['strip-glimmer-utils', { source: '@glimmer/utils', bindings: ['unwrap'] }]]"},{"note":"Plugin is written as ESM; .default is needed for CJS require.","wrong":"const stripGlimmerUtils = require('babel-plugin-strip-glimmer-utils')","symbol":"require in Node.js (CJS)","correct":"const stripGlimmerUtils = require('babel-plugin-strip-glimmer-utils').default"}],"quickstart":{"code":"// babel.config.js\nmodule.exports = {\n  plugins: [\n    ['strip-glimmer-utils', {\n      source: '@glimmer/utils',\n      bindings: ['unwrap', 'expect']\n    }]\n  ]\n};\n\n// Before:\nimport { unwrap } from '@glimmer/utils';\nconsole.log(unwrap(someValue));\n\n// After (in production):\n// import removed, call replaced with its argument\nconsole.log(someValue);","lang":"javascript","description":"Demonstrates configuration and effect: removes unwrap and expect from @glimmer/utils in production."},"warnings":[{"fix":"Use Babel 7 or later; not compatible with Babel 6.","message":"Plugin only works with Babel 7+","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Verify the exact export names from the source package.","message":"Bindings listed in config must be actual named exports from @glimmer/utils; otherwise plugin may fail silently.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consider forking or using manual tree-shaking. Check compatibility with your @glimmer/utils version.","message":"Plugin has not been updated in 4+ years; may not cover newer versions of @glimmer/utils.","severity":"deprecated","affected_versions":"<=0.1.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use require('babel-plugin-strip-glimmer-utils').default","cause":"Plugin imported via require without .default in CJS environment.","error":"TypeError: Cannot read properties of undefined (reading 'default')"},{"fix":"Ensure configuration is { source: '@glimmer/utils', bindings: ['unwrap'] }","cause":"Missing or incorrect configuration object (e.g., passing string instead of array for bindings).","error":"Error: [BABEL] Unknown option: .bindings"},{"fix":"Install @glimmer/utils or adjust the 'source' option.","cause":"Source package not installed or misconfigured in config.","error":"Error: Cannot find module '@glimmer/utils'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}