{"id":13242,"library":"glov-build","title":"GLOV.js Build System","description":"GLOV.js Build System is a specialized build tool designed for JavaScript game development, emphasizing fast, incremental builds and live updates for assets across various formats. Currently at version 1.0.53, it is no longer under active development but maintains MEDIUM-HIGH API stability, being used in multiple production projects. Its primary differentiator lies in its tailored approach to handle the unique demands and scaling challenges of large game projects built within the GLOV.js ecosystem, aiming to overcome shortcomings found in more general-purpose build systems when applied to this specific context. It orchestrates builds through a system of 'tasks' and 'jobs', where individual jobs are executed incrementally only if their dependencies have changed, and their outputs trigger further tasks only if the output truly differs, ensuring efficient processing by only rebuilding what is strictly necessary.","status":"maintenance","version":"1.0.53","language":"javascript","source_language":"en","source_url":"https://github.com/Jimbly/npm-publish","tags":["javascript","glov","glovjs"],"install":[{"cmd":"npm install glov-build","lang":"bash","label":"npm"},{"cmd":"yarn add glov-build","lang":"bash","label":"yarn"},{"cmd":"pnpm add glov-build","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package primarily uses CommonJS `require` syntax. Direct ES Module `import` is not supported for the main export.","wrong":"import gb from 'glov-build';","symbol":"gb","correct":"const gb = require('glov-build');"},{"note":"Task definition is accessed as a method on the main `gb` object, not as a named export.","wrong":"import { task } from 'glov-build';","symbol":"gb.task","correct":"gb.task({...});"},{"note":"Constants like `SINGLE` and `ALL` are properties of the main `gb` export, not top-level named exports.","wrong":"import { SINGLE } from 'glov-build';","symbol":"gb.SINGLE","correct":"type: gb.SINGLE"}],"quickstart":{"code":"const gb = require('glov-build');\n\ngb.configure({\n  source: 'src',\n  statedir: 'out/.gbstate',\n  targets: {\n    dev: 'out',\n  },\n});\n\ngb.task({\n  name: 'copy',\n  input: 'txt/*.txt',\n  type: gb.SINGLE,\n  target: 'dev',\n  func: function copy(job, done) {\n    job.out(job.getFile());\n    done();\n  },\n});\n\ngb.task({\n  name: 'concat',\n  input: [\n    'txt/*.txt',\n    'txt/*.asc',\n  ],\n  type: gb.ALL,\n  target: 'dev',\n  func: function concatSimple(job, done) {\n    let files = job.getFiles();\n    let buffer = Buffer.concat(files.filter(a => a.contents).map(a => a.contents));\n    job.out({\n      relative: 'concat.txt',\n      contents: buffer,\n    });\n    done();\n  },\n});\n\ngb.task({\n  name: 'default',\n  deps: ['copy', 'concat'],\n});\n\ngb.go({\n  tasks: ['default'],\n  watch: true,\n});","lang":"javascript","description":"This example demonstrates how to configure `glov-build`, define two basic tasks ('copy' for single files and 'concat' for multiple files), establish dependencies, and run a default build with file watching."},"warnings":[{"fix":"Consider its 'maintenance' status when planning long-term project dependencies; be prepared to contribute or fork for specific needs.","message":"GLOV.js Build System is no longer under active development. While used in production, new features or active maintenance should not be expected. Users should be prepared for community-driven support or potential forks for future enhancements.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Evaluate its suitability for your project's specific needs, especially if not within the GLOV.js or game development sphere. Refer to the GLOV.js build scripts for complex real-world usage examples.","message":"The build system is primarily tailored for the GLOV.js ecosystem and large JavaScript game development projects. While general-purpose build tasks can be created, its core design and optimizations are geared towards this specific use case, which might lead to less optimal experiences or lack of specific features for non-game or non-GLOV.js projects.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always use `const gb = require('glov-build');` to import the module. If integrating into an ESM-only project, consider a CommonJS wrapper or a dedicated build step for transpilation.","message":"All examples and common usage patterns rely on CommonJS `require()` syntax. Attempting to use ES Module `import` syntax directly for the main `glov-build` module will likely result in import errors or unexpected behavior due to its older architecture.","severity":"breaking","affected_versions":"<=1.x"},{"fix":"Carefully select `gb.SINGLE` or `gb.ALL` based on whether your job needs to process files individually or collectively. Ensure your `func` implementation correctly handles the input format (`job.getFile()` vs `job.getFiles()`) for the chosen type.","message":"Tasks using `gb.SINGLE` will execute the job function once per *changed* input file, while `gb.ALL` executes once for *all* relevant input files. Misunderstanding this distinction can lead to incorrect build outputs or inefficient processing.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Run `npm install glov-build` or `yarn add glov-build` in your project directory. Ensure the `require()` path is correct.","cause":"The package is not installed or incorrectly referenced.","error":"Error: Cannot find module 'glov-build'"},{"fix":"Verify that `const gb = require('glov-build');` was executed successfully and `gb` holds the module export. `task` is a method of the main `gb` object, not a standalone function or named export.","cause":"Attempting to call `task` as a named import or on an undefined `gb` object.","error":"TypeError: gb.task is not a function"},{"fix":"Ensure `job.out()` receives an object with at least `relative` and `contents` (or a `File` object from `job.getFile()`). Always call `done()` at the end of your job function to signal completion, even if an error occurs.","cause":"`job.out()` was called with an invalid object or contents, or `done()` was not called.","error":"Job output not recognized or file not written: relative: 'file.txt'"},{"fix":"Review the `input` glob pattern for syntax errors. Ensure the paths are relative to the configured `source` directory or absolute if specified.","cause":"Incorrect or malformed glob pattern provided for `input` in a task definition.","error":"Error: Watcher failed for input glob: 'src/*.js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"glov-build"}