npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@microsoft/gulp-core-build-typescript

v8.6.2

Published

`gulp-core-build-typescript` contains `gulp-core-build` subtasks for compiling and linting TypeScript code.

Downloads

42,579

Readme

@microsoft/gulp-core-build-typescript

gulp-core-build-typescript contains gulp-core-build subtasks for compiling and linting TypeScript code.

npm version Build Status Dependencies

TypescriptTask

Usage

The task for building TypeScript into JavaScript.

Config

See the ITypeScriptTaskConfig interface for the definition.

failBuildOnErrors

Fails the build when errors occur.

Default: true

sourceMatch

An array of glob matches for files to be included in the build.

Default:

[
  'src/**/*.ts',
  'src/**/*.tsx',
  'typings/main/**/*.ts',
  'typings/main.d.ts',
  'typings/tsd.d.ts',
  'typings/index.d.ts'
]

staticMatch

Array of glob matches for files that should by passed through (copied) to the build output.

Default:

[
  'src/**/*.js',
  'src/**/*.json',
  'src/**/*.jsx'
]

reporter

Custom TypeScript reporter.

Should be an interface conforming to:

interface IErrorReporter {
  error: (error: ITypeScriptErrorObject) => void
}

Default: a custom function which writes errors to the console.

typescript

Optional override of the typescript compiler. Set this to the result of require('typescript').

Default: undefined

removeCommentsFromJavaScript

Removes comments from all generated .js files. Will not remove comments from generated .d.ts files.

Default: false

emitSourceMaps

If true, creates sourcemap files which are useful for debugging.

Default: true

TSLintTask

Usage

The task for linting the TypeScript code.

By default, it includes a cache, such that files which have not been updated since the last linting are not checked again, unless the config or tslint version has changed.

Config

See the ITSLintTaskConfig interface for the definition.

lintConfig

The tslint configuration object.

Default: {}

rulesDirectory

Directories to search for custom linter rules. An array of glob expressions.

Default: the tslint-microsoft-contrib directory

sourceMatch

Provides the glob matches for files to be analyzed.

Default: ['src/**/*.ts', 'src/**/*.tsx']

reporter

A function which reports errors to the proper location. It should conform to the following interface:

((result: lintTypes.LintResult, file: Vinyl, options: ITSLintTaskConfig) => void;)

Defaults to using the base GulpTask's this.fileError() function.

displayAsWarning

If true, displays warnings as errors. If the reporter function is overwritten, it should reference this flag.

Default: false

removeExistingRules

If true, the lintConfig rules which were previously set will be removed. This flag is useful for ensuring that there are no rules activated from previous calls to setConfig().

Default: false

useDefaultConfigAsBase

If false, does not use a default tslint configuration as the basis for creating the list of active rules.

Default: true

RemoveTripleSlashReferencesTask

Usage

Removes any /// <reference path='...' /> entries from compiled D.TS files. This helps mitigate an issue with duplicated typings in TS 1.8.

Config

This task has no configuration options.

TextTask

Converts text files into JavaScript.

Usage

Config

See the ITextTaskConfig interface for the definition.

textMatch

Glob matches for files that should be converted into modules.

Default: ['src/**/*.txt']

Usage

To use these tasks in your build setup, simply import the package and add the task to a build task group.

Examples

Some examples of build packages that use this task:

Configuring task options

Use the standard "setConfig" method on task instances to set their configuration options. Example:

import { typescript } from '@microsoft/gulp-core-build-typescript';

typescript.setConfig({
  typescript: require('typescript')
});

Related projects

@microsoft/gulp-core-build - An abstraction around gulp that adds simplified serial/parallel task execution and a formal base task interface.

typescript - The TypeScript compiler.

License

MIT