Socket
Book a DemoInstallSign in
Socket

glovjs-build

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glovjs-build

GLOV.js Build System

latest
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

GLOV.js Build System

API Stability: LOW - under active development

A build system tailored for JavaScript game development, focused on fast, incremental builds with live updates of assets in many shapes and sizes. Created primarily for large projects built on GLOV.js in order to address the many shortcomings of other options that exhibit themselves as a project grows in size.

Simple example

const gb = require('glovjs-build');

gb.configure({
  source: 'src',
  statedir: 'out/.gbstate',
  targets: {
    dev: 'out',
  },
});

gb.task({
  name: 'copy',
  input: 'txt/*.txt',
  type: gb.SINGLE, // Type SINGLE - `func` is called once per changed input file
  target: 'dev',
  func: function copy(job, done) {
    job.out(job.getFile());
    done();
  },
});

gb.task({
  name: 'concat',
  input: [
    'txt/*.txt',
    'txt/*.asc',
  ],
  type: gb.ALL, // Type ALL - `func` is called once with all input files
  target: 'dev',
  func: function concatSimple(job, done) {
    let files = job.getFiles();
    let buffer = Buffer.concat(files.filter(a => a.contents).map(a => a.contents));
    job.out({
      relative: 'concat.txt',
      contents: buffer,
    });
    done();
  },
});

gb.task({
  name: 'default',
  deps: ['copy', 'concat'],
});

gb.go({
  tasks: ['default'],
  watch: true,
});

More Complex Examples

FAQs

Package last updated on 09 Apr 2021

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