当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript CLIOptions.getEnvironment方法代码示例

本文整理汇总了TypeScript中aurelia-cli.CLIOptions.getEnvironment方法的典型用法代码示例。如果您正苦于以下问题:TypeScript CLIOptions.getEnvironment方法的具体用法?TypeScript CLIOptions.getEnvironment怎么用?TypeScript CLIOptions.getEnvironment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aurelia-cli.CLIOptions的用法示例。


在下文中一共展示了CLIOptions.getEnvironment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: configureEnvironment

function configureEnvironment() {
  let env = CLIOptions.getEnvironment();

  return gulp.src(`aurelia_project/environments/${env}.js`)
    .pipe(rename('environment.js'))
    .pipe(gulp.dest(project.paths.root));
}
开发者ID:itainteasy,项目名称:cli,代码行数:7,代码来源:build-javascript.ts

示例2: configureEnvironment

function configureEnvironment() {
  let env = CLIOptions.getEnvironment();

  return gulp.src(`aurelia_project/environments/${env}.ts`)
    .pipe(changedInPlace({firstPass:true}))
    .pipe(rename('environment.js'))
    .pipe(gulp.dest(project.paths.root));
}
开发者ID:agileraymond,项目名称:cli,代码行数:8,代码来源:transpile.ts

示例3: configureEnvironment

function configureEnvironment() {
  let env = CLIOptions.getEnvironment();

  return gulp.src(`aurelia_project/environments/${env}${project.transpiler.fileExtension}`)
    .pipe(rename(`environment${project.transpiler.fileExtension}`))
    .pipe(gulp.dest(project.paths.root))
    .pipe(through.obj(function (file, enc,  cb) {
      // https://github.com/webpack/watchpack/issues/25#issuecomment-287789288
      var now = Date.now() / 1000;
      var then = now - 10;
      fs.utimes(file.path, then, then, function (err) { if (err) throw err });
      cb(null, file);
    }));
}
开发者ID:AshleyGrant,项目名称:cli,代码行数:14,代码来源:environment.ts

示例4: Configuration

import * as webpackConfig from '../../webpack.config';
import * as webpack from 'webpack';
import * as project from '../aurelia.json';
import {CLIOptions, Configuration} from 'aurelia-cli';

const buildOptions = new Configuration(project.build.options);
const isProd = CLIOptions.getEnvironment() === 'prod';
const server = buildOptions.isApplicable('server');
const extractCss = buildOptions.isApplicable('extractCss');
const coverage = buildOptions.isApplicable('coverage');

const config = webpackConfig({
  isProd, server, extractCss, coverage
});
const compiler = webpack(config);

function build(done) {
  compiler.run(onBuild);
  compiler.plugin('done', () => done());
}

function onBuild(err, stats) {
  if (err) {
    console.error(err.stack || err);
    if (err.details) console.error(err.details);
    process.exit(1);
  } else {
    process.stdout.write(stats.toString({ colors: require('supports-color') }) + '\n');
  }
}
开发者ID:reyno-uk,项目名称:cli,代码行数:30,代码来源:build-webpack.ts

示例5: onChange

import * as gulp from 'gulp';
import * as browserSync from 'browser-sync';
import * as historyApiFallback from 'connect-history-api-fallback/lib';
import * as project from '../aurelia.json';
import build from './build';
import {CLIOptions} from 'aurelia-cli';

const env = CLIOptions.getEnvironment(),
  baseDir = env === 'prod' ? project.paths.export : '.';

function onChange(path) {
  console.log(`File Changed: ${path}`);
}

function reload(done) {
  browserSync.reload();
  done();
}

let serve = gulp.series(
  build,
  done => {
    browserSync({
      online: false,
      open: false,
      port: 9000,
      logLevel: 'silent',
      server: {
        baseDir: [baseDir],
        middleware: [historyApiFallback(), function(req, res, next) {
          res.setHeader('Access-Control-Allow-Origin', '*');
开发者ID:Resounding,项目名称:Jobs-Web,代码行数:31,代码来源:run.ts


注:本文中的aurelia-cli.CLIOptions.getEnvironment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。