This repo contains all core gulp build tasks which can be configured and used in any FEAR projects alltogether or individually.

The tasks in this repo are provided in a factory function format for developer convenience, so you can use the functionality but can give any name to the task you create and configure it as much as the Core Task API makes it possible (see examples below).

Installation

To use any of the provided Core gulp tasks, please install the module first:

$ npm install --save-dev fear-core-build

then to use:

require('fear-core-build');

Usage

return gulp.task('inline-css', tasks.css.inline(sources, options));

Most tasks use the above common api.

| Argument | Description | |---------------|---------------| |sources |glob string or array of globs | |options |destination {String} optionally supplied if output folder is different to inpit (e.g sass compiled to css folder|

See task documentation for additional properties that can be added to the options object

Further reading


Changelog

3.3.0

  • switch uglify mangle off by default

3.2.5

  • use mns eslint instead of fear eslint

3.2.4

  • add ignoreCustomFragments options to html minification

3.2.0

  • add facility to suffix minified scripts e.g index.js -> index.min.js

3.1.0

  • allow bundler options to be passed from parent application
  • allow creation of sfx as well as existing default bundles
  • add basic javascript bundling unit tests
  • allow for bundling in different module formats (amd, cjs etc)

3.0.2

  • add blob matching to builder
  • consolidate all js bundle task options to one object
  • update systemjs-builder version due to bug in previous

2.0.2

  • added option to delete original files and just keep revisioned files

2.0.1

  • use Object.assign polyfill for older node versions

2.0.0

  • new destination approach that uses file being process basePath
  • standardise task api arguments to (sources, options)

1.2.0

  • new feature to enable revisioning of asset file names and references

1.1.6

  • update to systemjs-builder 0.15.16

1.1.5

  • using forked version of gulp-sass due to dependency on node-sass breaking compilation

1.1.4

  • fixed system js build issue, where metadata was not being applied to bundles

1.1.3

  • refactored JS bundle task to use systemJS

1.1.2

  • move to gulp-clean-css as gulp-minify-css deprecated
  • move to gulp-htmlmin as gulp-minify-html deprecated
  • removed unused and moved dev dependencies to correct place

1.1.1

  • removed instances of where global variables were used

1.1.0

  • decoupled module from other core modules

1.0.0

  • first npm publish


Contributing

Here's the most direct way to get your work merged into the project:

If your work is a new feature or a patch then follow the following workflow

  • Fork the project.
  • Clone down your fork ( git clone git@github.com:[username]/fear-core-build.git ).
  • Create a topic branch to contain your change ( git checkout -b my_awesome_feature ).
  • Code away and add tests if applicable. Not necessarily in that order.
  • Make sure everything still passes by running npm run test.
  • Update the change log with details of the change and then mark in brackets what type of change it is (new feature/patch). The version of the next published version will then be decided by this.
  • If necessary, rebase your commits into logical chunks, without errors.
  • Push the branch up ( git push origin my_awesome_feature ).
  • Create a pull request against fear-core-ui/master and describe what your change does and the why you think it should be merged.

If your work is a breaking change please come to talk to the core team before commencing development.