本文整理汇总了TypeScript中aurelia-cli.CLIOptions类的典型用法代码示例。如果您正苦于以下问题:TypeScript CLIOptions类的具体用法?TypeScript CLIOptions怎么用?TypeScript CLIOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CLIOptions类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: runWebpack
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: project.platform.port,
contentBase: config.output.path,
historyApiFallback: true,
open: project.platform.open,
stats: {
colors: require('supports-color')
},
https: config.devServer.https
} as any;
if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.entry.app.unshift(`webpack-dev-server/client?http://${opts.host}:${opts.port}/`, 'webpack/hot/dev-server');
}
const compiler = webpack(config);
let server = new Server(compiler, opts);
// tslint:disable-next-line:only-arrow-functions
server.listen(opts.port, opts.host, function(err) {
if (err) { throw err; }
reportWebpackReadiness(opts);
done();
});
}
开发者ID:jbockle,项目名称:aurelia-json-schema-form,代码行数:33,代码来源:run.ts
示例2: Karma
let karma = done => {
new Karma({
configFile: path.join(__dirname, '/../../test/karma.conf.js'),
singleRun: !CLIOptions.hasFlag('watch'),
autoWatch: CLIOptions.hasFlag('watch')
}, function(exitCode) {
console.log('Karma has exited with ' + exitCode)
process.exit(exitCode)
}).start();
};
开发者ID:AshleyGrant,项目名称:cli,代码行数:10,代码来源:karma.ts
示例3: runProtractor
export function runProtractor(done) {
return gulp.src(`${e2ePath}/**.js`)
.pipe(protractor({
configFile: __dirname + '/../../protractor.conf.js',
args: [
'--baseUrl',
CLIOptions.hasFlag('baseUrl') ? CLIOptions.getFlagValue('baseUrl') : 'http://127.0.0.1:9000'
]
}))
.on('end', function() { done(); })
.on('error', function(e) { throw e; });
};
开发者ID:j-party,项目名称:game,代码行数:12,代码来源:e2e.ts
示例4: 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
示例5: 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
示例6: runWebpack
function runWebpack(done) {
// https://webpack.github.io/docs/webpack-dev-server.html
let opts = {
host: '0.0.0.0',
publicPath: config.output.publicPath,
filename: config.output.filename,
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
port: project.platform.port,
contentBase: config.output.path,
historyApiFallback: true,
open: project.platform.open,
stats: {
colors: require('supports-color')
}
} as any;
if (!CLIOptions.hasFlag('watch')) {
opts.lazy = true;
}
if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.entry.app.unshift(`webpack-dev-server/client?http://${opts.host}:${opts.port}/`, 'webpack/hot/dev-server');
}
const compiler = webpack(config);
let server = new Server(compiler, opts);
server.listen(opts.port, opts.host, function(err) {
if (err) throw err;
if (opts.lazy) {
buildWebpack(() => {
reportWebpackReadiness(opts);
done();
});
} else {
reportWebpackReadiness(opts);
done();
}
});
}
开发者ID:adamfur,项目名称:helix,代码行数:42,代码来源:run.ts
示例7: 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
示例8: default
export default (cb) => {
let options = packageJson.jest;
if (CLIOptions.hasFlag('watch')) {
Object.assign(options, { watch: true});
}
jest.runCLI(options, [path.resolve(__dirname, '../../')], (result) => {
if(result.numFailedTests || result.numFailedTestSuites) {
cb(new gutil.PluginError('gulp-jest', { message: 'Tests Failed' }));
} else {
cb();
}
});
};
开发者ID:reyno-uk,项目名称:cli,代码行数:15,代码来源:jest.ts
示例9: browserSync
done => {
browserSync({
online: false,
open: CLIOptions.hasFlag('open'),
port: 9000,
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();
});
}
开发者ID:AshleyGrant,项目名称:cli,代码行数:21,代码来源:run.ts
示例10: Karma
let karma = done => {
new Karma({
configFile: __dirname + '/../../karma.conf.js',
singleRun: !CLIOptions.hasFlag('watch')
}, done).start();
};
开发者ID:Resounding,项目名称:Jobs-Web,代码行数:6,代码来源:test.ts
注:本文中的aurelia-cli.CLIOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论