ct-build-process v5.4.14
Synopsis
That's a set of configs and scripts built on top of gulp and webpack
that help us deliver the awesome
Blocksy theme.
Code Example
Example gulpfile.js
const gulp = require('gulp')
const buildProcess = require('ct-build-process')
const data = require('./package.json')
var options = {
entries: [
{
entry: './static/js/main.js',
output: {
path: './static/bundle/',
},
},
],
sassFiles: [
{
input: 'static/sass/style.scss',
output: 'static/bundle',
header: buildProcess.headerFor(false, data),
},
],
browserSyncEnabled: true,
sassWatch: ['assets/*/sass/**/*.scss'],
toClean: ['static/bundle/'],
}
buildProcess.registerTasks(gulp, options)Motivation
We wanted a clean way of building assets in a consistent manner across many repositories. That's the best thing we were able to come up with.
Installation
npm install --save-dev ct-build-processThen build your own gulpfile.js on top of our module. Read the code if you
need more details about the various config flags we have here.
API Reference
Every task here respects NODE_ENV=production in its own way. Minification,
source maps, watching - all of this is present just in development.
There are two types of packages:
wordpress_themeunyson_extension
Webpack tasks
gulp webpack- one time build. Doesn't watch if you setNODE_ENV=production
SASS tasks
gulp sass- one time buildgulp sass:watch-gulp sasswith watcher
Bump version
Some tasks that will look at your package type and replace the current version with the bumped one. Very convenient.
wordpress_theme- will look in:bower.json,package.json,style.cssunyson_extension- will look inpackage.jsonandmanifest.php
gulp bump:majorgulp bump:minorgulp bump:patchorgulp bump
Uses node-semver.
Create build
There are some specific tasks for creating and publishing new releases of
WordPress themes and Unyson extensions. This tasks will respect options.packageType
option.
The build:create_release tasks depends strongly on github-release
package. You should go ahead and install it and make it available in your $PATH
variable, otherwise you won't be able to benefit from this task. Also,
GITHUB_TOKEN should be exported by your shell login script (like bashrc or zshrc).
export GITHUB_TOKEN=YOUR_GITHUB_TOKENgulp build:remove_tmp- will removebuild_tmpdirectory in your packagegulp build:copy_files- will copy files to your build dir, with respect of your .gitignore.gulp build:delete_files_from_build- deleteoptions.filesToDeleteFromBuildgulp build:prepare_production_zipgulp build- a combination of the four abovegulp build:create_releasegulp build:publish- a combination ofbuildandbuild:create_release
Other tasks
gulp clean- will clean all the files. Respectsoptions.toCleanalsogulp build-gulp clean; gulp webpack; gulp sassgulp dev-gulp build; gulp sass:watchNODE_ENV=production gulp build- reliable way of building assets for productionNODE_ENV_GETTEXT=true gulp build- build & extract I18N strings
Stripe Code
gulp build:strip_code- Will stripe code that's between a pair of comments matched by regex. You have to specify a list of files to look into. Comments and list of files is configurable.
Options
packageType- unyson_extension | wordpress_themecurrentVersion- current package version used bygulp bumpentries- Multiple entries for webpack-multi-compiler. They have some syntactic sugar likewebpackIncludePathswebpackExternalswebpackResolveAliaseswebpackPluginswebpackAdditionalModulessassFiles- array of objects that specify input and output for sass compilersassIncludePathsbrowserSyncEnabledbrowserSyncInitOptionswatchFilesAndReload- list of files for browser sync - will cause browser to reload when any of them is changed at the fs leveltoClean- list of files forgulp cleanstripCodeStartCommentstripCodeEndCommentfilesToStripCodeFrom-gulp build:strip_codestuff
License
MIT
1 year ago
1 year ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago