Registry / devops / ember-cli-swc-minifier

ember-cli-swc-minifier

JSON →
library2.1.2jsnpmunverified

JavaScript minification addon for Ember-CLI using esbuild (SWC under the hood). Current stable version is 2.1.2, requires Node >= 18, and is actively maintained on GitHub. It replaces ember-cli-terser or ember-cli-uglify, offering faster builds via SWC. Key differentiators: seamless Ember integration, supports modern JS only (no ES5), configurable SWC minify options, source map support, and exclusion patterns.

npm install ember-cli-swc-minifier
INSTALL
IMPORT
SIG · EMBER-CLI-SWC-MINI
E
ember-cli-swc-minifier
devopsjavascriptv2.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

ember-cli-swc-minifier
import App from './app'; new EmberApp({ 'ember-cli-swc-minifier': { enabled: true } });
import minifier from '@nullvoxpopuli/ember-cli-swc-minifier'; minifier()
This is a build tool addon, not a runtime import. Configure in ember-cli-build.js via EmberApp options.
@nullvoxpopuli/ember-cli-swc-minifier
npm install --save-dev @nullvoxpopuli/ember-cli-swc-minifier
npm install --save ember-cli-swc-minifier
Package name includes scope @nullvoxpopuli; installed as devDependency.
EmberApp
const app = new EmberApp(defaults, { 'ember-cli-swc-minifier': { options } });
const app = new EmberApp(defaults, { minifier: { ... } });
Configuration key must be exactly 'ember-cli-swc-minifier' (string) in the options object.

Shows configuration of ember-cli-swc-minifier in ember-cli-build.js with basic options.

// ember-cli-build.js 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function(defaults) { const app = new EmberApp(defaults, { 'ember-cli-swc-minifier': { enabled: true, // defaults to true for production exclude: ['vendor.js'], swc: { compress: { drop_console: true } }, }, }); return app.toTree(); };
Debug
Known issues
breakingeclsm v2 is ESM-only, dropping support for the workspace-addon and is v2-only.
fix
Ensure your Ember-CLI version supports v2 addons and Node >= 18. Remove workspace-addon references.
affects: >=2.0.0
breakingThe package name changed from 'ember-cli-swc-minifier' to '@nullvoxpopuli/ember-cli-swc-minifier'.
fix
Uninstall old package: npm remove ember-cli-swc-minifier; install new: npm install --save-dev @nullvoxpopuli/ember-cli-swc-minifier.
affects: >=2.0.0
deprecatedOption 'uglify' and 'terser' are not supported; use 'swc' instead.
fix
Use 'swc' property to pass ESBuild/SWC minification options. See swc.rs/docs.
affects: *
gotchaSource maps are disabled by default in production. Enabling via sourcemaps config in ember-cli-build.js may not work if esbuild sourcemap option is not set.
fix
Set 'sourceMap' option inside 'ember-cli-swc-minifier' config to enable source maps: { sourceMap: 'linked' }.
affects: *
gotchaExclude paths are relative to the output directory (e.g., 'assets/app.js'), not source paths.
fix
Use output filenames like 'app.js', 'vendor.js'. No leading slash.
affects: *
gotchaES5 is not supported; only modern JavaScript (ES2015+) can be minified.
fix
Ensure your Ember-CLI build targets modern browsers or transpile to ES2015+ before minification.
affects: *
Errors
Common errors & fixes
Cannot find module 'ember-cli-swc-minifier'
Package renamed to @nullvoxpopuli/ember-cli-swc-minifier in v2.
fix
Run 'npm install --save-deve @nullvoxpopuli/ember-cli-swc-minifier' and update imports/config accordingly.
TypeError: Cannot read properties of undefined (reading 'isDevelopment')
The addon expects a valid EmberApp environment; may occur if defaults not passed.
fix
Ensure ember-cli-build.js exports a function that receives 'defaults' and passes it to new EmberApp().
Error: Minification failed: ... 'esbuild' not found
Missing @nullvoxpopuli/ember-cli-swc-minifier peer dependency esbuild.
fix
Run 'npm install --save-dev esbuild'.
Error: The 'ember-cli-swc-minifier' addon does not support CommonJS
v2 addons are ESM-only; using require() in config may fail.
fix
Use 'import' syntax or ensure your ember-cli-build.js is treated as ESM (e.g., .mjs extension).
Upgrade
Version history
2.1.2latest on npm
Audit
Dependencies
ember-clirequiredPeer dependency: this is an Ember-CLI addon that hooks into the build pipeline.
Agent activity
2 hits · last 30 days
node
2
Resources
ember-cli-swc-minifier — npm install ember-cli-swc-minifier · libregistry