本文整理汇总了TypeScript中m2e-build-tools.m2ePackages.map方法的典型用法代码示例。如果您正苦于以下问题:TypeScript m2ePackages.map方法的具体用法?TypeScript m2ePackages.map怎么用?TypeScript m2ePackages.map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类m2e-build-tools.m2ePackages
的用法示例。
在下文中一共展示了m2ePackages.map方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: require
import {join} from 'path';
import {task, watch} from 'gulp';
import {m2ePackages, buildConfig, sequenceTask} from 'm2e-build-tools';
// There are no type definitions available for these imports.
const runSequence = require('run-sequence');
const {packagesDir, projectDir} = buildConfig;
/** Builds everything that is necessary for karma. */
task(':test:build', sequenceTask(
'clean',
// Build ESM output of M2E that also includes all test files.
...m2ePackages.map((p) => `${p}:build-tests`),
));
/**
* Runs the unit tests. Does not watch for changes.
* This task should be used when running tests on the CI server.
*/
task('test:single-run', [':test:build'], (done: () => void) => {
// Load karma not outside. Karma pollutes Promise with a different implementation.
let karma = require('karma');
new karma.Server({
configFile: join(projectDir, 'test/karma.conf.js'),
singleRun: true
}, (exitCode: number) => {
// Immediately exit the process if Karma reported errors, because due to
// potential still running tunnel-browsers gulp won't exit properly.
exitCode === 0 ? done() : process.exit(exitCode);
示例2: require
import {m2ePackages, buildConfig, sequenceTask} from 'm2e-build-tools';
import {default as chalk} from 'chalk';
// These types lack of type definitions
const madge = require('madge');
/** Glob that matches all SCSS or CSS files that should be linted. */
const stylesGlob = '+(tools|src)/**/*.+(css|scss)';
/** List of flags that will passed to the different TSLint tasks. */
const tsLintBaseFlags = [
'-c', 'tslint.json', '+(src|e2e|tools)/**/*.ts', '--exclude', '**/node_modules/**/*'
];
/** Path to the output of the Material package. */
const m2eOutPaths = m2ePackages.map((p) => join(buildConfig.outputDir, 'packages', `${p}`));
task('lint', ['tslint', 'stylelint', 'madge']);
/** Task to lint Angular Material's scss stylesheets. */
task('stylelint', execNodeTask(
'stylelint', [stylesGlob, '--config', 'stylelint-config.json', '--syntax', 'scss']
));
/** Task to run TSLint against the e2e/ and src/ directories. */
task('tslint', execNodeTask('tslint', tsLintBaseFlags));
/** Task that automatically fixes TSLint warnings. */
task('tslint:fix', execNodeTask(
'tslint', [...tsLintBaseFlags, '--fix'])
);
示例3: require
import {writeFileSync, mkdirpSync} from 'fs-extra';
import {Bundler} from 'scss-bundle';
import {m2ePackages, composeRelease, buildConfig, sequenceTask} from 'm2e-build-tools';
import {calendarPackage, masonryPackage} from '../packages';
import {execTask} from '../util/task_helpers';
// There are no type definitions available for these imports.
const gulpRename = require('gulp-rename');
const {packagesDir, outputDir} = buildConfig;
/** Path to the directory where all releases are created. */
const releasesDir = join(outputDir, 'releases');
/** Path to the output of the Ajf packages. */
const m2eOutputPaths = m2ePackages.map((p) => join(outputDir, 'packages', `${p}`));
// Path to the sources of the Ajf package.
const m2ePaths = m2ePackages.map((p) => join(packagesDir, `${p}`));
// Path to the release output of m2e.
const releasePaths = m2ePackages.map((p) => join(releasesDir, `${p}`));
// Matches all SCSS files in the library.
const allScssGlobs = m2ePaths.map((p) => join(p, '**/*.scss'));
[calendarPackage, masonryPackage].forEach((p) => {
task(`m2e-${p.name}:build-release`, () => composeRelease(p));
});
/**
* Overwrite the release task for the m2e package.
*/
task('m2e:build-release', ['m2e:prepare-release'], sequenceTask(