本文整理匯總了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(