How to use @angular/cli - 10 common examples

To help you get started, we’ve selected a few @angular/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 angular / angular-cli / tests / acceptance / init.spec.js View on Github external
var glob = require('glob');
var Blueprint = require('@angular/cli/ember-cli/lib/models/blueprint');
var path = require('path');
var tmp = require('../helpers/tmp');
var root = path.join(__dirname, '../../packages/@angular/cli');
var util = require('util');
var minimatch = require('minimatch');
var intersect = require('lodash/intersection');
var remove = require('lodash/remove');
var unique = require('lodash/uniq');
var forEach = require('lodash/forEach');
var any = require('lodash/some');
var EOL = require('os').EOL;
var existsSync = require('exists-sync');

var defaultIgnoredFiles = Blueprint.ignoredFiles;

describe('Acceptance: ng update', function () {
  this.timeout(20000);

  beforeEach(function () {
    // Make a copy of defaultIgnoredFiles.
    Blueprint.ignoredFiles = defaultIgnoredFiles.splice(0);

    return tmp.setup('./tmp').then(function () {
      process.chdir('./tmp');
    });
  });

  afterEach(function () {
    return tmp.teardown('./tmp');
  });
github MoonCrystalPower / Dr.Jekyll / webpack.config.js View on Github external
// drop any unreachable code.

  plugins.push(new CopyWebpackPlugin ([
    { 
      from: path.join(__dirname, "Dr.Hyde"), 
      to: "Dr.Hyde/" 
    }
  ]));

  plugins.push(new DefinePlugin({
    "process.env.NODE_ENV": "\"production\""
  }));

  plugins.push(new NoEmitOnErrorsPlugin());

  plugins.push(new GlobCopyWebpackPlugin({
    "patterns": [
      "assets",
      "favicon.ico"
    ],
    "globOptions": {
      "cwd": process.cwd() + "/src",
      "dot": true,
      "ignore": "**/.gitkeep"
    }
  }));

  plugins.push(new ProgressPlugin());

  plugins.push(new HtmlWebpackPlugin({
    "template": "./src/index.html",
    "filename": "./index.html",
github aguskov1987 / arango-graphit / webpack.config.js View on Github external
function getPlugins() {
  var plugins = [];

  // Always expose NODE_ENV to webpack, you can now use `process.env.NODE_ENV`
  // inside your code for any environment checks; UglifyJS will automatically
  // drop any unreachable code.
  plugins.push(new DefinePlugin({
    "process.env.NODE_ENV": "\"production\""
  }));

  plugins.push(new NoEmitOnErrorsPlugin());

  plugins.push(new GlobCopyWebpackPlugin({
    "patterns": [
      "assets",
      "favicon.ico"
    ],
    "globOptions": {
      "cwd": process.cwd() + "/src",
      "dot": true,
      "ignore": "**/.gitkeep"
    }
  }));

  plugins.push(new ProgressPlugin());

  plugins.push(new HtmlWebpackPlugin({
    "template": "./src/index.html",
    "filename": "./index.html",
github atlasmap / atlasmap / app-poc / webpack.config.js View on Github external
// drop any unreachable code.
  plugins.push(new DefinePlugin({
    "process.env.NODE_ENV": "\"production\""
  }));

  plugins.push(new NoEmitOnErrorsPlugin());

if(scripts.length > 0){
  plugins.push(new ConcatPlugin({
    "uglify": false,
    "sourceMap": true,
    "name": "scripts",
    "fileName": "[name].bundle.js",
    "filesToConcat": scripts
  }));
  plugins.push(new InsertConcatAssetsWebpackPlugin([
    "scripts"
  ]));
}

  plugins.push(new GlobCopyWebpackPlugin({
    "patterns": [
      "assets",
      "favicon.ico"
    ],
    "globOptions": {
      "cwd": process.cwd() + "/src",
      "dot": true,
      "ignore": "**/.gitkeep"
    }
  }));
github BreezeHub / BreezeProject / Breeze.UI / webpack.config.js View on Github external
// drop any unreachable code.
  plugins.push(new DefinePlugin({
    "process.env.NODE_ENV": "\"production\""
  }));

  plugins.push(new NoEmitOnErrorsPlugin());

  if (scripts.length > 0) {
    plugins.push(new ConcatPlugin({
      "uglify": false,
      "sourceMap": true,
      "name": "scripts",
      "fileName": "[name].bundle.js",
      "filesToConcat": scripts
    }));
    plugins.push(new InsertConcatAssetsWebpackPlugin([
      "scripts"
    ]));
  }

  plugins.push(new CopyWebpackPlugin([
    {
      "context": "src",
      "to": "",
      "from": {
        "glob": "assets/**/*",
        "dot": true
      }
    },
    {
      "context": "src",
      "to": "",
github kleder / timetracker / webpack.config.js View on Github external
// drop any unreachable code.
  //plugins.push(new DefinePlugin({
  //  "process.env.NODE_ENV": "\"production\""
  //}));

  plugins.push(new NoEmitOnErrorsPlugin());

if(scripts.length > 0){
  plugins.push(new ConcatPlugin({
    "uglify": false,
    "sourceMap": true,
    "name": "scripts",
    "fileName": "[name].bundle.js",
    "filesToConcat": scripts
  }));
  plugins.push(new InsertConcatAssetsWebpackPlugin([
    "scripts"
  ]));
}

  plugins.push(new GlobCopyWebpackPlugin({
    "patterns": [
      "assets",
      "splash.html"
    ],
    "globOptions": {
      "cwd": process.cwd() + "/src",
      "dot": true,
      "ignore": "**/.gitkeep"
    }
  }));
github Mindmapp / mindmapp / webpack.config.js View on Github external
// drop any unreachable code.
    plugins.push(new DefinePlugin({
        "process.env.NODE_ENV": "\"production\""
    }));

    plugins.push(new NoEmitOnErrorsPlugin());

    if (scripts.length > 0) {
        plugins.push(new ConcatPlugin({
            "uglify": false,
            "sourceMap": true,
            "name": "scripts",
            "fileName": "[name].bundle.js",
            "filesToConcat": scripts
        }));
        plugins.push(new InsertConcatAssetsWebpackPlugin([
            "scripts"
        ]));
    }

    plugins.push(new GlobCopyWebpackPlugin({
        "patterns": [
            "assets",
            "icon.png"
        ],
        "globOptions": {
            "cwd": process.cwd() + "/src",
            "dot": true,
            "ignore": "**/.gitkeep"
        }
    }));
github JetBrains / intellij-plugins / AngularJS / src / ngCli / schematicsProvider60.ts View on Github external
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import {SchematicsProvider} from "./schematicsProvider";

let schematicsUtils = require('@angular/cli/utilities/schematics');

let defaultCollectionName;
try {
    defaultCollectionName = require('@angular/cli/utilities/config').getDefaultSchematicCollection();
} catch (e) {
    defaultCollectionName = require('@angular/cli/models/config').CliConfig.getValue('defaults.schematics.collection');
}
let engineHost = schematicsUtils.getEngineHost()

const schematicsProvider: Promise = Promise.resolve({
    getCollection: schematicsUtils.getCollection,
    getSchematic: schematicsUtils.getSchematic,
    listSchematics(collection): string[] {
        return engineHost.listSchematics(collection)
    },
    getDefaultSchematicCollection: () => defaultCollectionName
})

export = schematicsProvider;
github JetBrains / intellij-plugins / AngularJS / src / ngCli / schematicsProvider62.ts View on Github external
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import {Collection, Schematic} from '@angular-devkit/schematics';
import {SchematicsProvider} from "./schematicsProvider";
import {SchematicCommand} from "@angular/cli/models/schematic-command";

let command = new (SchematicCommand as any)({}, null);

let defaultCollectionName;
try {
    defaultCollectionName = require('@angular/cli/utilities/config').getDefaultSchematicCollection();
} catch (e) {
    defaultCollectionName = require('@angular/cli/models/config').CliConfig.getValue('defaults.schematics.collection');
}
let engineHost = command.getEngineHost();

const schematicsProvider: Promise = Promise.resolve({
    getCollection(collectionName: string): Collection {
        return command.getCollection(collectionName);
    },
    listSchematics(collection): string[] {
        return engineHost.listSchematics(collection)
    },
    getSchematic(collection: Collection, schematicName: string, allowPrivate?: boolean): Schematic {
        return command.getSchematic(collection, schematicName, allowPrivate);
    },
    getDefaultSchematicCollection() {
        return defaultCollectionName;
    }
github pnp / generator-spfx / generators / angularelements / promptConfig.js View on Github external
"use strict"

const path = require('path');
const process = require('process');

let defaultOpts = '--style=scss --routing=false --skip-git';

try {

    const ngVersion = require('@angular/cli/package.json');

    if (ngVersion.version.startsWith('7') ||
        ngVersion.version.startsWith('8')) {
        defaultOpts = defaultOpts + ' --enable-ivy'
    };

} catch (error) {}

// check if user want to have exntend linking capability
const configOptions = [{
        type: 'input',
        message: 'What is your solution name?',
        name: 'solutionName',
        when: (answers) => answers.framework === 'angularelements',
        default: path.basename(process.cwd()),
        validate: (input) => input.indexOf('-') === -1 && input.indexOf('_') === -1 ? true : 'Dashes or underscores are not allowed in solution name'
    },
    {
        type: 'input',