
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
ember-cli-build-config-editor
Advanced tools
Utility for ember blueprints to use to modify ember-cli-build.js
Utility for ember blueprints to use to modify ember-cli-build.js
For installation in a non-Ember project:
npm install ember-cli-build-config-editor --save-dev
For installation in an Ember project:
ember install ember-cli-build-config-editor
Note: This package only handles flat configurations at this point.
var BuildConfigEditor = require('ember-cli-build-config-editor.js');
var fs = require('fs');
// Specify 'utf-8' to force it to be a string instead of a buffer
var source = fs.readFileSync('./ember-cli-build.js', 'utf-8');
var build = new BuildConfigEditor(source);
var config = build.retrieve('some-addon');
// Do something with the config
Use this from your Ember blueprint to add or update configuration options in your ember-cli-build.js
.
var BuildConfigEditor = require('ember-cli-build-config-editor.js');
var fs = require('fs');
// Specify 'utf-8' to force it to be a string instead of a buffer
var source = fs.readFileSync('./ember-cli-build.js', 'utf-8');
var build = new BuildConfigEditor(source);
build.edit('some-addon', {
booleanProperty: false,
numericProperty: 17,
stringProperty: 'wow'
});
fs.writeFileSync('./ember-cli-build.js', build.code());
The above example modifies ember-cli-build.js
in the following ways
'some-addon'
key in the options object of your EmberApp
construction, creating one
if it doesn't existKeys that are not specified are preserved untouched. Added object keys are single-quoted for safety.
TypeError: this.source.charCodeAt is not a function
You have passed a buffer instead of a string to the constructor. Add the encoding
argument
when you read the file, e.g., var source = fs.readFileSync('./ember-cli-build.js', 'utf-8')
.
npm install
npm test
The AST for the basic configuration can be found in this SVG for reference. It was generated from Rappid's JavaScript AST Visualizer.
The approach used here is based on that for ember-router-generator.
The DSL for AST types used by esprima provided great insight once I got my head around it.
Please fork the project and submit pull requests and issues using GitHub.
FAQs
Utility for ember blueprints to use to modify ember-cli-build.js
The npm package ember-cli-build-config-editor receives a total of 0 weekly downloads. As such, ember-cli-build-config-editor popularity was classified as not popular.
We found that ember-cli-build-config-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.