gulpConfig

Source: gulp.config.mjs:9

Modify these configurations to match your project specifications.


Other

ArrayableSetting: Array.<string> | string

A setting that may be an array of strings or a string only.

BooleanSetting: boolean

A setting that may be true or false.

FlagNumberSetting: false | number

A setting that may be flag 'false' or provide a number

FlagStringSetting: false | StringSetting

A setting that may be flag 'false' or provide a StringSetting

FlagsSetting: Object.<string, BooleanSetting>

An object of boolean settings used as flags.

JestTestFlags: FlagsSetting

Configure cli options for running Jest.

Properties

StringSetting: string

A setting that may only be a string.

Setting: ArrayableSetting | BooleanSetting | FlagNumberSetting | FlagsSetting | StringSetting

Any single configuration option is a Setting.

CopyFilesEntry: Object

One copy-files entry: a glob (or array of globs) to copy, and where to copy it.

Properties

  • from (ArrayableSetting) — The glob pattern(s) of files to copy.
  • to (StringSetting) — The directory to copy them into.
  • base (FlagStringSetting) — Optional base for gulp's own src(pattern, {base}), to preserve a glob's own subdirectory structure in the destination instead of flattening it. false (the default) uses gulp's own default base behaviour.

BrowserConfig: Object.<string, Setting>

Configurations for building the browser files.

Properties

  • enabled (BooleanSetting) — 'true' to generate browser bundled files; 'false' for node environment only
  • from (StringSetting) — The search pattern used for retrieving compiled distribution files.
  • name (StringSetting) — The name to use for the browser-bundled output file (.js will be appended).
  • to (StringSetting) — The output directory for browser-bundled files.
  • ignore (ArrayableSetting) — Module names or file paths which resolve to an empty object ({}) in the bundle instead of their real contents. For a dependency which is only reached because it is the default value of an option you always override (for example a selector engine's default DOM adapter, when you always pass your own), this keeps it (and anything only it requires) out of the bundle, as long as your code never actually reaches the real module by not overriding that option. Matches browserify's b.ignore(file): a module name (also any file inside that package), or a file path with its extension, starting with './' or '/'.
  • exclude (ArrayableSetting) — Module names or file paths left out of the bundle entirely; requiring one at runtime throws unless something else provides it (for example a script tag loading it separately). Passed to esbuild's external (a module name also covers its subpaths, such as name/lib/file).
  • bundles (Array.<module:gulpConfig~AdditionalBundleConfig>) — Additional bundles to produce alongside the primary one (name/dist.main/ignore/exclude above) - for example a render-only variant built from a different entry point than the full bundle. Empty by default: a project that never sets this gets exactly the one bundle it always did.

AdditionalBundleConfig: Object.<string, Setting>

One additional bundle - everything but name falls back to the primary bundle's own value when omitted, so an additional bundle only has to specify what's actually different about it.

Properties

  • name (StringSetting) — The name for this bundle's output file and standalone export - must be unique among all of a project's bundles.
  • main (StringSetting, optional) — This bundle's own entry point. Falls back to dist.main when omitted.
  • ignore (ArrayableSetting, optional) — This bundle's own ignore list. Falls back to browser.ignore when omitted.
  • exclude (ArrayableSetting, optional) — This bundle's own exclude list. Falls back to browser.exclude when omitted.

DistConfig: Object.<string, Setting>

Configurations for building the node distribution files.

Properties

  • from (StringSetting) — The search pattern used for gathering source files for distribution.
  • main (StringSetting) — Name of the entry the distribution file.
  • to (StringSetting) — The output directory for the distribution files.

FontConfig: Object.<string, Setting>

Configurations for copying the font files.

Properties

ImageConfig: Object.<string, Setting>

Configurations to minify and copy the images.

Properties

  • cacheDir (StringSetting) — Where optimized images are cached between runs, so an image that hasn't changed isn't optimized again. An upgrade of imagemin (or its plugins) or other settings starts new results. Inside node_modules by default, so it's never committed; old entries aren't pruned, so delete it now and then to start over.
  • enabled (BooleanSetting) — Toggle image minify and copy process.
  • from (StringSetting) — Path to search for images.
  • jpegQuality (FlagNumberSetting) — The JPEG quality (0 to 100) mozjpeg compresses to. False (the default) keeps mozjpeg's own default, 75. Raise it (85 is usually indistinguishable from the original) when 75 visibly bands smooth gradients.
  • to (StringSetting) — Path to output images.

LintConfig: Object.<string, Setting>

Configurations for linting (see module:partials.neostandardLint).

Properties

  • include (ArrayableSetting) — Extra folders to lint alongside srcPath, for hand-written code that lives outside it (for example scripts). Linted with the same rules, and fixed in place, like srcPath. Empty by default: a project that never sets this lints srcPath only, as before.
  • rules (Object.<string, *>) — ESLint rule overrides layered on top of neostandard's own config, scoped to the same files neostandard itself lints. For a rule that is wrong for your project specifically (for example a test fixture that deliberately contains text neostandard mistakes for a real syntax problem), rather than something to fix in your code. Empty by default: a project that never sets this gets exactly neostandard's own rules, unchanged. Keyed and valued exactly as ESLint's own rules object - see https://eslint.org/docs/latest/use/configure/rules.

ReadmeConfig: Object.<string, Setting>

Configurations to compile and generate the Readme file.

Properties

  • enabled (BooleanSetting) — Generate the readme from the jsdoc comments, in build and in the readme task. False (the default) keeps a hand-written readme, or none. Independent of docs.enabled: turn on either, both, or neither.
  • file (StringSetting) — The name of the output documentation markdown file.
  • from (StringSetting) — Location of files to use for compiling documentation into the readme.
  • fromEsm (ArrayableSetting) — Additional .mjs files to document alongside from, converted on the fly since the readme generator only recognizes .js files - see 'Configure including ESM files in the generated readme'. Empty by default: a project that never sets this gets exactly the readme it always did.
  • options (ArrayableSetting) — Options for formatting the output readme.
  • template (StringSetting) — The file which will be pre-fixed to your README.md output. When it doesn't exist, the readme holds only the generated documentation.
  • to (StringSetting) — The directory to output the readme file in.

DocsConfig: Object.<string, Setting>

Configurations for generating the HTML documentation of a project's own source, with either TypeDoc (real TypeScript types) or jsdoc (a modern theme over jsdoc's own classic default) - see docs.method.

Properties

  • basePath (FlagStringSetting) — The path the documentation is served from, such as '/projects/my-lib/docs/' (jsdoc with clean-jsdoc-theme 5.x only). The theme's links start at the site root, so documentation served below it needs this. False (the default) serves it from the site root.
  • bodyHtml (FlagStringSetting) — HTML added to every page of the documentation just before </body>, with either engine, for example the analytics script the rest of the site has. False (the default) adds nothing.
  • enabled (BooleanSetting) — Toggle generating the documentation from the source. Independent of readme.enabled: turn on either, both, or neither.
  • from (ArrayableSetting) — The directory holding the source, each folder in it becomes a module (TypeDoc) or is scanned recursively (jsdoc). jsdoc also takes a list of directories and files.
  • gitRevision (FlagStringSetting) — The git revision TypeDoc's "Defined in" source links point to (TypeDoc only). False (the default) is TypeDoc's own: the current commit, which changes every page on every commit. A branch name such as 'main' keeps the pages unchanged until the documentation itself changes; '{branch}' is the branch being built.
  • headHtml (FlagStringSetting) — HTML added to every page of the documentation just before </head>, with either engine. False (the default) adds nothing.
  • inBuild (BooleanSetting) — Generate the documentation as part of build (the default). Turn it off to only generate it when you run the docs task yourself (gulp docs), for example when docs.to points into another repository and you only want to publish the documentation of a release.
  • index (StringSetting) — The markdown file used as the front page of the documentation.
  • logLevel (StringSetting) — How much TypeDoc reports: Verbose, Info, Warn, Error or None. Not used by jsdoc.
  • method (FlagStringSetting) — 'typedoc' or 'jsdoc'. False (the default) infers it from typescript.enabled - 'typedoc' when on, 'jsdoc' when off - so an existing TypeScript project's config needs no change to keep working exactly as it already does; set this explicitly to override that inference either way.
  • theme (StringSetting) — The jsdoc theme package to use (only meaningful when method is 'jsdoc' - TypeDoc keeps its own default regardless). Defaults to 'clean-jsdoc-theme'.
  • title (StringSetting) — The name of the documentation, defaults to the name in the package.json.
  • to (StringSetting) — The directory to generate the documentation in (it is cleared first).
  • tsconfig (FlagStringSetting) — The tsconfig file to read the source with (TypeDoc only), defaults to the one of typescript.config.

SassConfig: Object.<string, Setting>

Configurations to compile and copy the sass files into css.

Properties

  • enabled (BooleanSetting) — Toggle SASS to CSS process on.
  • from (StringSetting) — The pattern for finding all sass files.
  • path (StringSetting) — The directory were sass files will be stored.
  • to (StringSetting) — The destination path for where generated CSS (from SASS files) should go.

TestConfig: Object.<string, Setting>

Configurations for running the test suite.

Properties

  • options (JestTestFlags) — Additional flags for programmatically running Jest Cli.
  • path (ArrayableSetting) — The directory where Jest test files are stored. By default, stored as *.test.js adjacent to the files they are testing.
  • watch (ArrayableSetting) — The search pattern for watching files for changes.

TsConfig: Object.<string, Setting>

Configurations for compiling typescript into JS files.

Properties

  • config (FlagStringSetting) — The path the tsconfig file for running typescript or false if no ts file given.
  • enabled (BooleanSetting) — Toggle usage of typescript parsing.
  • from (StringSetting) — Pattern for finding the TypeScript files.
  • to (StringSetting) — Directory where parsed typescript files go.

Configurations: Object.<string, Setting>

A set of Configurations options defined by Settings.

Properties

  • browser (BrowserConfig) — Browser bundling configuration group.
  • cleanPaths (ArrayableSetting) — The paths for directories to delete before build.
  • copyFiles (Array.<CopyFilesEntry>) — Files to copy elsewhere, run via the copyFiles task - never automatically as part of build, since what this copies is often the live, publicly-reachable version of something (e.g. a bundle), and publishing it should be a deliberate step.
  • dist (DistConfig) — Distribution file generation configuration group.
  • docs (DocsConfig) — Generate the documentation of a TypeScript project configuration group.
  • fonts (FontConfig) — Fonts copy configuration group.
  • images (ImageConfig) — Minify and copy the images configuration.
  • lint (LintConfig) — Linting configuration group.
  • readme (ReadmeConfig) — Build readme files configuration.
  • rootPath (StringSetting) — Base directory of the project.
  • sass (SassConfig) — Compile CSS from SASS configuration.
  • srcPath (StringSetting) — The directory where your source files are stored (the files you manually created).
  • test (TestConfig) — Run test suite configuration.
  • typescript (TsConfig) — Compile from typescript configuration.

get

Retrieve a value from the configurations, default may be returned.

Parameters

  • path (string | null)
  • defaultValue (*)

Returns

  • * | null

set

Specify a value for the configurations to use.

Parameters

  • path
  • value

Returns

  • *