How to use the ember-cli/lib/commands/build.extend function in ember-cli

To help you get started, we’ve selected a few ember-cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lifeart / ember-cli-fallback-builds / lib / commands / build-fallback.js View on Github external
/* eslint-env node */

"use strict";

const { join } = require("path");
const BuildCommand = require("ember-cli/lib/commands/build");
const BuildTask = require("../tasks/build");

const defaultOut = join("dist");

module.exports = BuildCommand.extend({
  name: "build:fallback",
  description: `Builds your ember app for Electron and places it into the output path (${defaultOut} by default).`,

  // eslint-disable-next-line
  availableOptions: [
    {
      name: "environment",
      type: String,
      default: "development",
      aliases: ["e", { dev: "development" }, { prod: "production" }],
      description:
        'Possible values are "development", "production", and "test".'
    },
    { name: "output-path", type: "Path", default: defaultOut, aliases: ["o"] },
    { name: "suppress-sizes", type: Boolean, default: false }
  ],
github isleofcode / ember-cli-asset-sizes-shim / lib / commands / asset-sizes.js View on Github external
var BuildCommand = require('ember-cli/lib/commands/build');

var Command = BuildCommand.extend({
  name: 'asset-sizes',
  description: 'Builds a production version of your app and places it into the output path (dist/ by default) while logging asset sizes.',
  aliases: ['a'],

  availableOptions: [
    { name: 'sizes', type: Boolean, default: true, aliases: ['s'] },
    { name: 'environment', type: String,  default: 'production', aliases: ['e', { 'dev': 'development' }, { 'prod': 'production' }] },
    { name: 'trace', type: String, aliases: ['t'] },
    { name: 'trace-all', type: Boolean, default: false, aliases: ['ta'] },
    { name: 'output-path', type: 'Path', default: 'dist/', aliases: ['o'] },

    // these are on the build command, but don't really serve us well here
    { name: 'suppress-sizes', type: Boolean, default: true },
    { name: 'watch', type: Boolean, default: false, aliases: ['w'] },
    { name: 'watcher', type: String }
  ],
github adopted-ember-addons / ember-electron / lib / commands / build.js View on Github external
'use strict';

const BuildCommand = require('ember-cli/lib/commands/build');
const prepareRunCommand = require('../utils/prepare-run-command');
const { emberBuildPath } = require('../utils/build-paths');

module.exports = BuildCommand.extend({
  name: 'electron:build',
  description: `Builds your ember app for Electron and installs it in the Electron app.`,

  availableOptions: buildAvailableOptions(),

  async run() {
    let _super = this._super;
    await prepareRunCommand(this.project);
    return _super.apply(this, arguments);
  }
});

function buildAvailableOptions() {
  // We don't whitelist options here since this command maps so directly to the
  // base command (just with an extra env variable and different default output
  // path)
github isleofcode / ember-cli-asset-sizes-shim / lib / commands / build.js View on Github external
var BuildCommand = require('ember-cli/lib/commands/build');

var Command = BuildCommand.extend({
  availableOptions: [
    { name: 'environment',    type: String,  default: 'development', aliases: ['e', { 'dev': 'development' }, { 'prod': 'production' }] },
    { name: 'output-path',    type: 'Path',  default: 'dist/',       aliases: ['o'] },
    { name: 'watch',          type: Boolean, default: false,         aliases: ['w'] },
    { name: 'watcher',        type: String },
    { name: 'suppress-sizes', type: Boolean, default: false },
    { name: 'asset-sizes', type: Boolean, default: false, aliases: ['a'] },
    { name: 'trace-asset', type: String, aliases: ['t'] },
    { name: 'trace-all', type: Boolean, default: false, aliases: ['ta'] }
  ],

  run: function(commandOptions) {
    process._flags = commandOptions;
    return this._super.run.call(this, commandOptions);
  }