Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@joinbox/build-task
Advanced tools
Re-usable Gulp 4 tasks for Joinbox projects that cover the following file types:
The tasks support:
BuildTaskBuilder exposes the following tasks when using the default config:
gulp
: First clears your destination directory, then calls dev
, then watch
and then starts up
a browserSync webservergulp prod
: Clears destination, then creates production filesgulp serve
: Just boots up and runs the server; changes won't be watched (as no watch tasks are
started)gulp clean
: Removes the destination folderjsDev
: Clears JS folder in destination, converts JS files, then haltsjsWatch
: Only watches JS files (triggers on change)js
: jsDev
then jsWatch
jsProd
: Clears JS folder in destination, converts and minifies files for productioncssDev
: Clears CSS folder in destination, converts css files, then haltscssWatch
: Only watches CSS files (triggers on change)css
: cssDev
then cssWatch
cssProd
: Clears CSS folder in destination, converts and minifies files for productionhtmlDev
: Clears HTML folder in destination, copies all HTML fileshtmlWatch
: Only watches HTML files (triggers on change)html
: htmlDev
then htmlWatch
htmlProd
: Clears HTML folder in destination, converts and minifies files for productionSee default settings. Can be changed with setConfig
(see
below).
Create a new folder
Install gulp 4 and build-task locally, gulp-cli globally:
npm i -D @joinbox/build-task gulp@4 gulpjs/gulp-cli
Add a gulpfile.js …
touch gulpfile.js
Add a start
script to your package.json
:
{
scripts: {
start: 'node ./node_modules/gulp-cli/bin/gulp.js'
}
}
Either use the default config …
const BuildTask = require('@joinbox/build-task');
const builder = new BuildTask();
module.exports = builder.createTasks();
… or adjust it to match your own setup:
// Require and initialize our builder:
const BuildTask = require('@joinbox/build-task');
const builder = new BuildTask();
// Update/change config. The configuration is an object; pass the path to the
// property you desire to change and set its new value. See src/defaultConfig
// for defaults.
builder.setConfig('paths.css.entryPoints', ['styles.scss']);
builder.setConfig('paths.js.technologies', ['react']);
builder.setConfig('supportedBrowsers', ['>1%']);
// Don't export the server gulp task; when calling gulp's default task, it won't
// start either
builder.setConfig('server', false);
// Create a custom task
// imgDev copies images to destination directory
// imgWatch watches changes on images and copies them to destination directory
const imageSources = 'www/src/**/*.png';
function imgDev() {
return gulp.src(imageSources)
.pipe(gulp.dest('www/dist'));
}
function imgWatch() {
return gulp.watch(imageSources, imgDev);
}
// Add your tasks to builder.tasks: they will become part of the object returned by
// createTasks(). builder.tasks is a Map; the key is the tasks's name, the value the
// corresponding function.
// Your functions cann now be invoked by calling gulp imgWatch or gulp imgDev
builder.tasks.set('imgWatch', imgWatch);
builder.tasks.set('imgDev', imgDev);
// Add your task to builder.devTasks and builder.watchTasks; this will call them
// within the default gulp task. devTasks and watchTasks are arrays.
builder.devTasks.push(imgDev);
builder.watchTasks.push(imgWatch);
// Export tasks to expose them to gulp
module.exports = builder.createTasks();
Run your tasks
As you added your own imgWatch
and imgDev
functions to the gulp task, they will now be part
of the default gulp task and therefore be invoked when executing:
gulp
A word about PATHS:
npm test
.test
folder:
cd test && gulp -f gulpfile.default.js
FAQs
Re-usable esbuild/swc and Sass based build tasks for Joinbox Drupal projects
The npm package @joinbox/build-task receives a total of 31 weekly downloads. As such, @joinbox/build-task popularity was classified as not popular.
We found that @joinbox/build-task demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.