Registry / web-framework / babel-plugin-strip-glimmer-utils

babel-plugin-strip-glimmer-utils

JSON →
library0.1.1jsnpmunverified

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.

npm install babel-plugin-strip-glimmer-utils
INSTALL
IMPORT
SIG · BABEL-PLUGIN-STRIP
B
babel-plugin-strip-glimmer-utils
web-frameworkjavascriptv0.1.1
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 export (plugin)
import stripGlimmerUtils from 'babel-plugin-strip-glimmer-utils'
import { stripGlimmerUtils } from 'babel-plugin-strip-glimmer-utils'
Plugin is exported as default. Named export may lead to undefined.
plugin usage in Babel config
plugins: [['strip-glimmer-utils', { source: '@glimmer/utils', bindings: ['unwrap'] }]]
plugins: ['babel-plugin-strip-glimmer-utils']
Must provide configuration object with source and bindings.
require in Node.js (CJS)
const stripGlimmerUtils = require('babel-plugin-strip-glimmer-utils').default
const stripGlimmerUtils = require('babel-plugin-strip-glimmer-utils')
Plugin is written as ESM; .default is needed for CJS require.

Demonstrates configuration and effect: removes unwrap and expect from @glimmer/utils in production.

// babel.config.js module.exports = { plugins: [ ['strip-glimmer-utils', { source: '@glimmer/utils', bindings: ['unwrap', 'expect'] }] ] }; // Before: import { unwrap } from '@glimmer/utils'; console.log(unwrap(someValue)); // After (in production): // import removed, call replaced with its argument console.log(someValue);
Debug
Known issues
gotchaPlugin only works with Babel 7+
fix
Use Babel 7 or later; not compatible with Babel 6.
affects: >=0.0.0
gotchaBindings listed in config must be actual named exports from @glimmer/utils; otherwise plugin may fail silently.
fix
Verify the exact export names from the source package.
affects: >=0.1.0
deprecatedPlugin has not been updated in 4+ years; may not cover newer versions of @glimmer/utils.
fix
Consider forking or using manual tree-shaking. Check compatibility with your @glimmer/utils version.
affects: <=0.1.1
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'default')
Plugin imported via require without .default in CJS environment.
fix
Use require('babel-plugin-strip-glimmer-utils').default
Error: [BABEL] Unknown option: .bindings
Missing or incorrect configuration object (e.g., passing string instead of array for bindings).
fix
Ensure configuration is { source: '@glimmer/utils', bindings: ['unwrap'] }
Error: Cannot find module '@glimmer/utils'
Source package not installed or misconfigured in config.
fix
Install @glimmer/utils or adjust the 'source' option.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
@babel/coreoptionalRequired as a peer dependency to function as a Babel plugin.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-plugin-strip-glimmer-utils — npm install babel-plugin-strip-glimmer-utils · libregistry