當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript m2e-build-tools.m2ePackages類代碼示例

本文整理匯總了TypeScript中m2e-build-tools.m2ePackages的典型用法代碼示例。如果您正苦於以下問題:TypeScript m2ePackages類的具體用法?TypeScript m2ePackages怎麽用?TypeScript m2ePackages使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了m2ePackages類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: task

task('aot:copy-release', () => {
  m2ePackages.forEach((p) => {
    copySync(join(releasesDir, `${p}`), join(demoAppOut, `${p}`));
  });
});
開發者ID:gnucoop,項目名稱:material2-extra,代碼行數:5,代碼來源:aot.ts

示例2: 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);
開發者ID:gnucoop,項目名稱:material2-extra,代碼行數:31,代碼來源:unit-test.ts

示例3: 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'])
);
開發者ID:gnucoop,項目名稱:material2-extra,代碼行數:31,代碼來源:lint.ts

示例4: 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(
開發者ID:gnucoop,項目名稱:material2-extra,代碼行數:31,代碼來源:material2-extra-release.ts


注:本文中的m2e-build-tools.m2ePackages類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。