{"id":27697955,"url":"https://github.com/messageflow/build","last_synced_at":"2026-05-08T14:34:34.242Z","repository":{"id":143776073,"uuid":"126712063","full_name":"Messageflow/build","owner":"Messageflow","description":"Quick build with Gulp","archived":false,"fork":false,"pushed_at":"2018-05-29T06:35:50.000Z","size":1041,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T11:11:35.509Z","etag":null,"topics":["babel","build","build-tool","builder","compile","copy","gulp","lint","minify","tslint"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@messageflow/build","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Messageflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-25T15:33:17.000Z","updated_at":"2018-05-29T06:35:51.000Z","dependencies_parsed_at":"2023-06-07T22:30:30.205Z","dependency_job_id":null,"html_url":"https://github.com/Messageflow/build","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/Messageflow/build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Messageflow%2Fbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Messageflow%2Fbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Messageflow%2Fbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Messageflow%2Fbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Messageflow","download_url":"https://codeload.github.com/Messageflow/build/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Messageflow%2Fbuild/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266510591,"owners_count":23940673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","build","build-tool","builder","compile","copy","gulp","lint","minify","tslint"],"created_at":"2025-04-25T16:30:48.054Z","updated_at":"2026-05-08T14:34:34.201Z","avatar_url":"https://github.com/Messageflow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"text-align: center;\"\u003e\n  \u003ch1 style=\"border-bottom: none;\"\u003e@messageflow/build\u003c/h1\u003e\n\n  \u003cp\u003eQuick build with Gulp\u003c/p\u003e\n\u003c/div\u003e\n\n\u003chr /\u003e\n\n[![NPM][nodei-badge]][nodei-url]\n\n[![Version][version-badge]][version-url]\n[![Downloads][downloads-badge]][downloads-url]\n[![MIT License][mit-license-badge]][mit-license-url]\n[![Code of Conduct][coc-badge]][coc-url]\n\n[![Build Status][travis-badge]][travis-url]\n[![CircleCI][circleci-badge]][circleci-url]\n[![Dependency Status][daviddm-badge]][daviddm-url]\n[![NSP Status][nsp-badge]][nsp-url]\n[![Codecov][codecov-badge]][codecov-url]\n[![Coverage Status][coveralls-badge]][coveralls-url]\n\n[![codebeat-badge]][codebeat-url]\n[![codacy-badge]][codacy-url]\n\n\u003e Better build process with [Gulp][gulp-url] for general [Node.js][node-js-url] projects written in [TypeScript][typescript-url]. To embrace native ES modules in [Node.js][node-js-url], `@messageflow/build` allows you to build with compiling to any other module system such as `CommonJS` and also allows you to output files in the format of `.mjs`. See the [Using .mjs in Node.js][using-mjs-in-nodejs-url] section to learn how to use `.mjs` in Node.js.\n\n## Table of contents\n\n- [Pre-requisites](#pre-requisites)\n- [Setup](#setup)\n  - [Install](#install)\n  - [Usage](#usage)\n    - [gulpfile.js](#gulpfilejs)\n    - [How to build for FOSS](#how-to-build-for-foss)\n    - [Using .mjs in Node.js](#using-mjs-in-nodejs)\n- [API Reference](#api-reference)\n  - [DEFAULT_FOSS_CLEAN_GLOBS](#default_foss_clean_globs)\n  - [DEFAULT_IGNORE_GLOBS](#default_ignore_globs)\n  - [DEFAULT_BABEL_CONFIG](#default_babel_config)\n  - [Default FOSS configuration](#default-foss-configuration)\n  - [BuilderParams](#builderparams)\n  - [builder([options])](#builderoptions)\n- [License](#license)\n\n## Pre-requisites\n\n- [Node.js][node-js-url] \u003e= 8.9.0\n- [NPM][npm-url] \u003e= 5.5.1 ([NPM][npm-url] comes with [Node.js][node-js-url] so there is no need to install separately.)\n\n## Setup\n\n### Install\n\n```sh\n# Install via NPM as one of the `devDependencies`\n$ npm install --save-dev @messageflow/build\n```\n\n### Usage\n\n#### gulpfile.js\n\n```js\nconst gulp = require('gulp');\nconst { builder } = require('@messageflow/build');\n\nconst build = builder();\n/** `cleanGlobs` can be helpful when the destination directory is not the `dist` directory. */\n// const build = builder({\n//   dist: '.',\n//   cleanGlobs: [\n//     './*.js',\n//     './*.d.ts',\n//     '!./gulpfile.js',\n//     '!./json.d.ts',\n//   ],\n// });\n\ngulp.task('clean', build.clean);\ngulp.task('lint', build.lint);\ngulp.task('copy', build.copy);\ngulp.task('ts', build.ts);\ngulp.task('watch', build.watch);\ngulp.task('default', build.default); // or gulp.task('default', build.all);\n```\n\n#### How to build for FOSS\n\n```js\n// gulpfile.js\n\nconst gulp = require('gulp');\nconst builder = require('@messageflow/build').builder({ foss: true });\n/** This is equivalent to */\n// const builder = require('@messageflow/build').builder({\n//   dist: '.',\n//   cleanGlobs: [\n//     './*@(mj|j)s',\n//     './*.d.ts',\n//     '!./gulpfile.js',\n//     '!./json.d.ts',\n//   ],\n// })\n\ngulp.task('lint', builder.lint);\ngulp.task('default', builder.all);\n```\n\n#### Using .mjs in Node.js\n\n[Node.js][node-js-url] will import the correct dependencies based on the file extension you use. `.mjs` file will only import `.mjs` files.\n\n```js\n// main.mjs\nimport otherMod from './other-mod'; // This will import 'other-mod.mjs` but not 'other-mod.js'\n\n// main.js\nconst otherMod = require('./other-mod'); // This will import 'other-mod.js' but not 'other-mod.mjs'\n```\n\n## API Reference\n\n### DEFAULT_FOSS_CLEAN_GLOBS\n\n```js\n[\n  './*.@(mj|j)s',\n  './*.d.ts',\n  '!./gulpfile.js',\n  '!./json.d.ts',\n]\n```\n\n### DEFAULT_IGNORE_GLOBS\n\n```js\n[\n  '!**/demo*/**/*.ts*',\n  '!**/test*/**/*.ts*',\n]\n```\n\n### DEFAULT_BABEL_CONFIG\n\n```js\n{\n  presets: [\n    ['@babel/preset-env', {\n      targets: { node: 'current' },\n      spec: true,\n      modules: false,\n      useBuiltIns: 'usage',\n      shippedProposals: true,\n    }],\n    ['minify', {\n      replace: false,\n      mangle: { keepFnName: true },\n      removeConsole: false,\n      removeDebugger: true,\n    }],\n  ],\n}\n```\n\n### Default FOSS configuration\n\nWhen `foss` is set to true, the following flags will be set to use its default values:\n\n1. `dist` - `.`\n2. `cleanGlobs` - [DEFAULT_FOSS_CLEAN_GLOBS][default-foss-clean-globs-url]\n\n### BuilderParams\n\n- `src` \u003c[?string][string-mdn-url]\u003e Optional source directory. Defaults to `src`.\n- `dist` \u003c[?string][string-mdn-url]\u003e Optional destination directory. Defaults to `dist`.\n- `cleanGlobs` \u003c[?string][string-mdn-url]|[string][string-mdn-url][]\u003e Optional glob patterns to clean files/ directories up before every build process initiates. **_This is required only when the destination directory is not the `dist` directory._** Defaults to the value of `dist` if unspecified.\n- `copyGlobs` \u003c[?string][string-mdn-url]|[string][string-mdn-url][]\u003e Optional glob patterns to copy files/ directories to destination build directory. Defaults to `['\u003cSRC\u003e/**/*.*', '!\u003cSRC\u003e/**/*.ts*', '\u003cSRC\u003e/**/*.d.ts']`.\n- `ignoreGlobs` \u003c[?string][string-mdn-url]|[string][string-mdn-url][]\u003e Optional glob patterns to ignore files/ directories. Defaults to [DEFAULT_IGNORE_GLOBS][default-ignore-globs-url]. **_This only works when `isProd` is set to true._**\n- `isProd` \u003c[?boolean][boolean-mdn-url]\u003e Optional production flage. Set to `true` if the build process is meant for production. Defaults to `process.env.NODE_ENV === 'production'`.\n- `rootPath` \u003c[?string][string-mdn-url]\u003e Optional path to current working directory. Defaults to `.`.\n- `babelConfig` \u003c[?Object][object-mdn-url]\u003e Optional configuration for [Babel][babel-url]. **_This is only needed when `isProd` is set to true._** Defaults to [DEFAULT_BABEL_CONFIG][default-babel-config-url].\n- `tsConfig` \u003c[?string][string-mdn-url]\u003e Optional path to `tsconfig.json`. Defaults to `./tsconfig.json`.\n- `tslintConfig` \u003c[?string][string-mdn-url]\u003e Optional path to `tslint.json`. Defaults to `./tslint.json`. **_This defaults to `./tslint.prod.json` when `isProd` is set to true._**\n- `esModules` \u003c[?boolean][boolean-mdn-url]\u003e Optional ES modules flag to run compilation with native ES Modules. Defaults to `true`.\n- `mjs` \u003c[?boolean][boolean-mdn-url]\u003e Optional flag to run compilation with native ES modules and output files in the format of `.mjs`. Defaults to `false`. **_Native ES modules will be used and will ignore any value set by `esModules` if this is set to true_**\n- `foss` \u003c[?boolean][boolean-mdn-url]\u003e Optional flag to run compilation for [FOSS][foss-url]. Defaults to `false`. See [Default FOSS configuration][default-foss-configuration-url] to see what is being used under the hood.\n\n___\n\n### builder([options])\n\n- `options` \u003c[?BuilderParams][builderparams-url]\u003e Optional configuration for the build process.\n- returns: \u003c[Object][object-mdn-url]\u003e An object of build tasks to be assigned as [Gulp][gulp-url] task, e.g. `gulp.task('\u003cTASK_NAME\u003e', \u003cGULP_TASK_FUNCTION\u003e)`. It comprises of a list of tasks fo a common build process with Gulp for most of the projects:\n\n  1. `clean` - Always remove old files from previous build.\n  2. `lint` - Always lint all `.ts` files with given `tslint.json`.\n  3. `ts` - Compile all `.ts` files with given `tsconfig.json`.\n  4. `copy` - Copy all asset files such as `images`, `json`, `md`, etc.\n  5. `watch` - Run the build process by watching for flle changes.\n  6. `default` - Default build process that comprises all the above.\n  7. `all` - Another default build process to compile and output in both `.js` and `.mjs`. See the [How to build for FOSS][how-to-build-for-foss-url] section to learn how to use `@messageflow/build` to build your open source [Node.js][node-js-url] package using the `{ foss: true }` shorthand.\n\n## License\n\n[MIT License](https://motss.mit-license.org/) © Rong Sen Ng\n\n\u003c!-- References --\u003e\n[typescript-url]: https://github.com/Microsoft/TypeScript\n[node-js-url]: https://nodejs.org\n[npm-url]: https://www.npmjs.com\n[node-releases-url]: https://nodejs.org/en/download/releases\n[gulp-url]: https://github.com/gulpjs/gulp\n[babel-url]: https://github.com/babel/babel\n[foss-url]: https://en.oxforddictionaries.com/definition/foss\n\n[builderparams-url]: #builderparams\n[default-ignore-globs-url]: #default_ignore_globs\n[default-babel-config-url]: #default_babel_config\n[default-foss-clean-globs-url]: #default_foss_clean_globs\n[default-foss-configuration-url]: #default-foss-configuration\n[using-mjs-in-nodejs-url]: #using-mjs-in-nodejs\n[how-to-build-for-foss-url]: #how-to-build-for-foss\n\n[array-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\n[boolean-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n[function-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\n[map-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\n[number-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\n[object-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\n[promise-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n[regexp-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n[set-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\n[string-mdn-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n\n\u003c!-- Badges --\u003e\n[nodei-badge]: https://nodei.co/npm/@messageflow/build.png?downloads=true\u0026downloadRank=true\u0026stars=true\n\n[version-badge]: https://img.shields.io/npm/v/@messageflow/build.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dm/@messageflow/build.svg?style=flat-square\n[mit-license-badge]: https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n\n[travis-badge]: https://img.shields.io/travis/Messageflow/build.svg?style=flat-square\n[circleci-badge]: https://circleci.com/gh/Messageflow/build/tree/master.svg?style=svg\n[daviddm-badge]: https://img.shields.io/david/Messageflow/build.svg?style=flat-square\n[nsp-badge]: https://nodesecurity.io/orgs/messageflow/projects/4650ee88-a5b8-4474-bff4-7d55d8b2c51f/badge?style=flat-square\n[codecov-badge]: https://codecov.io/gh/Messageflow/build/branch/master/graph/badge.svg?style=flat-square\n[coveralls-badge]: https://coveralls.io/repos/github/Messageflow/build/badge.svg?branch=master\u0026style=flat-square\n\n[codebeat-badge]: https://codebeat.co/badges/ca230cdd-bdc5-4f9e-bd39-7b62d47f5fef?style=flat-square\n[codacy-badge]: https://api.codacy.com/project/badge/Grade/ef8c3a98c9e649d19a67ae78f980748a\n\n\u003c!-- Links --\u003e\n[nodei-url]: https://nodei.co/npm/@messageflow/build\n\n[version-url]: https://www.npmjs.com/package/@messageflow/build\n[downloads-url]: http://www.npmtrends.com/@messageflow/build\n[mit-license-url]: https://github.com/Messageflow/build/blob/master/LICENSE\n[coc-url]: https://github.com/Messageflow/build/blob/master/CODE_OF_CONDUCT.md\n\n[travis-url]: https://travis-ci.org/Messageflow/build\n[circleci-url]: https://circleci.com/gh/Messageflow/build/tree/master\n[daviddm-url]: https://david-dm.org/Messageflow/build\n[nsp-url]: https://nodesecurity.io/orgs/messageflow/projects/4650ee88-a5b8-4474-bff4-7d55d8b2c51f\n[codecov-url]: https://codecov.io/gh/Messageflow/build\n[coveralls-url]: https://coveralls.io/github/Messageflow/build?branch=master\n\n[codebeat-url]: https://codebeat.co/projects/github-com-messageflow-build-master\n[codacy-url]: https://www.codacy.com/app/Messageflow/build?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Messageflow/build\u0026amp;utm_campaign=Badge_Grade\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessageflow%2Fbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessageflow%2Fbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessageflow%2Fbuild/lists"}