New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@joinbox/build-task

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@joinbox/build-task

Re-usable esbuild/swc and Sass based build tasks for Joinbox Drupal projects

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
36
decreased by-26.53%
Maintainers
2
Weekly downloads
 
Created
Source

Intro

Build task for Joinbox' Drupal projects that provides command line actions running with reasonable defaults for JavaScripts and SASS.

Tasks include multiple options, the ability to emit notifications on success and source maps.

Installation

npm i -D @joinbox/build-task core-js regenerator-runtime

core-js and regenerator-runtime are required to inline the corresponding polyfills.

Commands

Styles

  • Converts SASS to CSS
  • Adds autoprefixes through postcss
  • Accepts globs for input files
  • Supports compression
  • Generates source maps
  • Creates output directory if it doesn't exist
  • Displays notification on success

Command

npx @joinbox/build-task styles -n -c -s src/scss -d dist/css **/*.scss

Options

To see all available options, call the styles build task with the help option (-h or --help):

npx @joinbox/build-task styles -h

Scripts

Command

npx @joinbox/build-task scripts -m -t es5 -e "ie 11" -s src/js -d dist/js **/*.js

Options

To see all available options, call the scripts build task with the help option (-h or --help):

npx @joinbox/build-task scripts -h

Complete Build Task for Projects

Use the following setup for Drupal projects:

  1. Install all additional modules: npm i -D chokidar-cli npm-run-all @babel/eslint-parser @joinbox/eslint-config-joinbox eslint @joinbox/stylelint-config-joinbox stylelint
  2. Add the following scripts property to your package.json:
    scripts: {
        "dev:styles": "npm run lint:styles ; npx @joinbox/build-task styles -n -s src/scss -d dist/css main.scss",
        "live:styles": "npx @joinbox/build-task styles -n -c -s src/scss -d dist/css main.scss",
        "watch:styles": "npx chokidar \"src/scss/**/*.scss\" \"template-library/**/*.scss\" -c \"npm run dev:styles\"",
        "dev:scripts": "npm run lint:scripts ; npx @joinbox/build-task scripts -n -s src/js -d dist/js main.js",
        "live:scripts": "npx @joinbox/build-task scripts -n -m -s src/js -d dist/js main.js",
        "watch:scripts": "npx chokidar \"src/js/**/*.js\" \"template-library/**/*.js\" -c \"npm run lint:scripts\" & npx @joinbox/build-task scripts -n -w -s src/js -d dist/js main.js",
        "copy:fonts": "mkdir -p dist/webfonts && cp -r src/webfonts dist/webfonts",
        "watch:fonts": "npx chokidar \"src/webfonts/**/*.*\" -c \"npm run copy:fonts\"",
        "copy:media": "mkdir -p dist/media && cp -r src/media dist/media",
        "watch:media": "npx chokidar \"src/media/**/*.*\" -c \"npm run copy:media\"",
        "clean": "(rm -r dist || true)",
        "lint:styles": "npx stylelint src/**/*.scss template-library/**/*.scss --config node_modules/@joinbox/stylelint-config-joinbox/index.js",
        "lint:scripts": "npx eslint src/**/*.js template-library/**/*.js -c node_modules/@joinbox/eslint-config-joinbox/index.js",
        "dev": "npm-run-all clean -p copy:* dev:* -p watch:*",
        "live": "npm-run-all clean -p copy:* live:*"
    }
    

Update from Earlier Versions

If you update from earlier versions, make sure to

  • remove all unnecessary NPM packages from package.json (especially @babel/core, browser-sync, @babel/eslint-parser, gulp, postcss)
  • remove unnecessary scripts from package.json
  • remove gulpfile.js
  • update @joinbox/build-task to newest version and follow this README's instructions

FAQs

Package last updated on 01 Dec 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc