How to use the aurelia-cli.CLIOptions.getFlagValue function in aurelia-cli

To help you get started, we’ve selected a few aurelia-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 zeit / now / test / dev / fixtures / 03-aurelia / aurelia_project / tasks / run.js View on Github external
function runWebpack(done) {
  // https://webpack.github.io/docs/webpack-dev-server.html
  let opts = {
    host: 'localhost',
    publicPath: config.output.publicPath,
    filename: config.output.filename,
    hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
    port: CLIOptions.getFlagValue('port') || project.platform.port,
    contentBase: config.output.path,
    historyApiFallback: true,
    open: project.platform.open || CLIOptions.hasFlag('open'),
    stats: {
      colors: require('supports-color')
    },
    ...config.devServer
  };

  // Add the webpack-dev-server client to the webpack entry point
  // The path for the client to use such as `webpack-dev-server/client?http://${opts.host}:${opts.port}/` is not required
  // The path used is derived from window.location in the browser and output.publicPath in the webpack.config.
  if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
    config.plugins.push(new webpack.HotModuleReplacementPlugin());
    config.entry.app.unshift('webpack-dev-server/client', 'webpack/hot/dev-server');
  } else {
github airform / airform / packages / aurelia-airform / aurelia_project / tasks / run.ts View on Github external
let serve = gulp.series(build, done => {
  bs.init(
    {
      online: false,
      open: CLIOptions.hasFlag('open') || project.platform.open,
      port: CLIOptions.getFlagValue('port') || project.platform.port,
      host:
        CLIOptions.getFlagValue('host') || project.platform.host || 'localhost',
      logLevel: 'silent',
      server: {
        baseDir: [project.platform.baseDir],
        middleware: [
          historyApiFallback(),
          function (req, res, next) {
            res.setHeader('Access-Control-Allow-Origin', '*')
            next()
          },
        ],
      },
    },
    function (err, bs) {
      if (err) return done(err)
      let urls = bs.options.get('urls').toJS()
      let host = bs.options.get('host')
github airform / airform / packages / aurelia-airform / aurelia_project / tasks / run.ts View on Github external
let serve = gulp.series(build, done => {
  bs.init(
    {
      online: false,
      open: CLIOptions.hasFlag('open') || project.platform.open,
      port: CLIOptions.getFlagValue('port') || project.platform.port,
      host:
        CLIOptions.getFlagValue('host') || project.platform.host || 'localhost',
      logLevel: 'silent',
      server: {
        baseDir: [project.platform.baseDir],
        middleware: [
          historyApiFallback(),
          function (req, res, next) {
            res.setHeader('Access-Control-Allow-Origin', '*')
            next()
          },
        ],
      },
    },
    function (err, bs) {
      if (err) return done(err)
github buttonwoodcx / bcx-aurelia-reorderable-repeat / aurelia_project / tasks / run.js View on Github external
done => {
    browserSync({
      online: false,
      open: CLIOptions.hasFlag('open'),
      port: CLIOptions.getFlagValue('port') || project.platform.port,
      logLevel: 'silent',
      server: {
        baseDir: [project.platform.baseDir],
        middleware: [historyApiFallback(), function(req, res, next) {
          res.setHeader('Access-Control-Allow-Origin', '*');
          next();
        }]
      }
    }, function (err, bs) {
      if (err) return done(err);
      let urls = bs.options.get('urls').toJS();
      log(`Application Available At: ${urls.local}`);
      log(`BrowserSync Available At: ${urls.ui}`);
      done();
    });
  }
github aurelia / cli / skeleton / cypress / cypress.config.js View on Github external
const CLIOptions =  require( 'aurelia-cli').CLIOptions;
const aureliaConfig = require('./aurelia_project/aurelia.json');
const PORT = CLIOptions.getFlagValue('port') || aureliaConfig.platform.port;
const HOST = CLIOptions.getFlagValue('host') || aureliaConfig.platform.host;

module.exports = {
  config: {
    baseUrl: `http://${HOST}:${PORT}`,
    fixturesFolder: 'test/e2e/fixtures',
    integrationFolder: 'test/e2e/integration',
    pluginsFile: 'test/e2e/plugins/index.js',
    screenshotsFolder: 'test/e2e/screenshots',
    supportFile: 'test/e2e/support/index.js',
    videosFolder: 'test/e2e/videos'
  }
};
github aurelia-contrib / aurelia-combo / aurelia_project / tasks / run.js View on Github external
done => {
    browserSync({
      online: false,
      open: CLIOptions.hasFlag('open'),
      port: CLIOptions.getFlagValue('port') || project.platform.port,
      logLevel: 'silent',
      server: {
        baseDir: [project.platform.baseDir],
        middleware: [historyApiFallback(), function(req, res, next) {
          res.setHeader('Access-Control-Allow-Origin', '*');
          next();
        }]
      }
    }, function (err, bs) {
      if (err) return done(err);
      let urls = bs.options.get('urls').toJS();
      log(`Application Available At: ${urls.local}`);
      log(`BrowserSync Available At: ${urls.ui}`);
      done();
    });
  }
github aurelia / cli / skeleton / cypress / cypress.config.js View on Github external
const CLIOptions =  require( 'aurelia-cli').CLIOptions;
const aureliaConfig = require('./aurelia_project/aurelia.json');
const PORT = CLIOptions.getFlagValue('port') || aureliaConfig.platform.port;
const HOST = CLIOptions.getFlagValue('host') || aureliaConfig.platform.host;

module.exports = {
  config: {
    baseUrl: `http://${HOST}:${PORT}`,
    fixturesFolder: 'test/e2e/fixtures',
    integrationFolder: 'test/e2e/integration',
    pluginsFile: 'test/e2e/plugins/index.js',
    screenshotsFolder: 'test/e2e/screenshots',
    supportFile: 'test/e2e/support/index.js',
    videosFolder: 'test/e2e/videos'
  }
};