All Projects → JS-DevTools → globify

JS-DevTools / globify

Licence: MIT license
Run browserify and watchify with globs - even on Windows!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to globify

glob-tool
A tool to test globs against sets of test strings quickly and easily for the DigitalOcean Community.
Stars: ✭ 14 (-12.5%)
Mutual labels:  glob-pattern, globs
Modular Css
A streamlined reinterpretation of CSS Modules via CLI, API, Browserify, Rollup, Webpack, or PostCSS
Stars: ✭ 234 (+1362.5%)
Mutual labels:  browserify
Template.js
A javascript template engine, simple, easy & extras, support webpack, rollup, parcel, browserify, fis and gulp
Stars: ✭ 1,201 (+7406.25%)
Mutual labels:  browserify
Gulp Bro
👊 gulp + browserify + incremental build, done right.
Stars: ✭ 119 (+643.75%)
Mutual labels:  browserify
Npm Pipeline Rails
Use npm as part of your Rails asset pipeline
Stars: ✭ 93 (+481.25%)
Mutual labels:  browserify
Cssify
Simple middleware for Browserify to add css styles to the browser.
Stars: ✭ 127 (+693.75%)
Mutual labels:  browserify
Buffer
The buffer module from node.js, for the browser.
Stars: ✭ 1,178 (+7262.5%)
Mutual labels:  browserify
matched
Glob matching with support for multiple patterns and negation. Use `~` in cwd to find files in user home, or `@` for global npm modules.
Stars: ✭ 25 (+56.25%)
Mutual labels:  glob-pattern
Minipack
📦 A simplified example of a modern module bundler written in JavaScript
Stars: ✭ 2,625 (+16306.25%)
Mutual labels:  browserify
Babel Plugin Prismjs
A babel plugin to use PrismJS with standard bundlers.
Stars: ✭ 114 (+612.5%)
Mutual labels:  browserify
Jus
🍉 An opinionated tool for making static websites with browserify
Stars: ✭ 107 (+568.75%)
Mutual labels:  browserify
React Tsx Starter
Universal/Isomorphic React TypeScript Starter Project
Stars: ✭ 97 (+506.25%)
Mutual labels:  browserify
Render Media
Intelligently render media files in the browser
Stars: ✭ 181 (+1031.25%)
Mutual labels:  browserify
Npm Rails
NPM support for Rails with Bundler-like DSL
Stars: ✭ 81 (+406.25%)
Mutual labels:  browserify
Sha.js
Streamable SHA hashes in pure javascript
Stars: ✭ 237 (+1381.25%)
Mutual labels:  browserify
String To Stream
Convert a string into a stream (streams2)
Stars: ✭ 75 (+368.75%)
Mutual labels:  browserify
Frontbook
📖 FrontBook is a small and modern frontend boilerplate, enabling you to write ES201* today in production-ready projects.
Stars: ✭ 102 (+537.5%)
Mutual labels:  browserify
Serverless Plugin Optimize
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript
Stars: ✭ 122 (+662.5%)
Mutual labels:  browserify
dots
Implements the wildcard file matching in Go used by golint, go test etc.
Stars: ✭ 26 (+62.5%)
Mutual labels:  glob-pattern
Routr
A component that provides router related functionalities for both client and server.
Stars: ✭ 241 (+1406.25%)
Mutual labels:  browserify

Globify

Run browserify and watchify with globs - even on Windows!

Cross-Platform Compatibility Build Status

Coverage Status Dependencies

npm License Buy us a tree

Features

  • Supports glob patterns for entry files - even on Windows
  • Optionally create separate browserify bundles for each entry file

Related Projects

Installation

Install using npm. Add the -g flag to install globally so you can use it from any terminal.

npm install -g @jsdevtools/globify

Usage

The command-line interface is identical to browserify and watchify. In fact, globify simply passes your arguments straight to browserify or watchify (after expanding the glob pattern).

globify <entry files glob>  [options]

Options:

  <entry files glob>

    Glob pattern of entry files. Don't forget to wrap the glob pattern in quotes,
    otherwise some shells (like bash) will pre-expand the glob.

  --outfile=FILE, -o FILE

    If outfile is a file, then a single bundle will be created.  If it's a directory,
    then separate bundles will be created for each entry file.  You can also specify
    an output filename pattern, like *.bundled.js

  --exclude=GLOB, -u GLOB

    Excludes files that are matched by the <entry files glob>

  --watch, -w

    Call watchify instead of browserify.

Examples

For all of these examples, assume that we have a file structure like this:

lib/
 |__ my-entry-file.js
 |__ some-file.js
 |__ other-file.js
 |__ other-entry-file.js
 |__ subdir/
       |__ another-entry-file.js
       |__ another-file.js
       |__ yet-another-file.js

Multiple files in one bundle

We want to bundle all three entry files into a single bundle file. We can do that with the following command:

globify "lib/**/*-entry-file.js" --outfile=dist/my-bundle.js

Globify will call browserify once, passing it the three matching entry files and one bundle file:

browserify lib/my-entry-file.js lib/other-entry-file.js lib/subdir/another-entry-file.js --outfile=dist/my-bundle.js

Multiple files, multiple bundles

We want to create separate bundle files for each of the three entry files. We can do that with the following command:

globify "lib/**/*-entry-file.js" --outfile=dist

Globify will call browserify three times (once for each entry file), and create three corresponding bundles:

browserify lib/my-entry-file.js --outfile=dist/my-entry-file.js
browserify lib/other-entry-file.js --outfile=dist/other-entry-file.js
browserify lib/subdir/another-entry-file.js --outfile=dist/subdir/another-entry-file.js

Multiple files, multiple bundles with customized names

We want to create separate bundle files for each of the three entry files, but we weant each bundle file to have a .bundled.js suffix. We can do that with the following command:

globify "lib/**/*-entry-file.js" -o "dist/*.bundled.js"

Globify will call browserify three times (once for each entry file) and create three corresponding bundles:

browserify lib/my-entry-file.js -o dist/my-entry-file.bundled.js
browserify lib/other-entry-file.js -o dist/other-entry-file.bundled.js
browserify lib/subdir/another-entry-file.js -o dist/subdir/another-entry-file.bundled.js

Watchify, transforms, other options

Now, let's try it with watchify instead. Let's also add some extra options, and run the uglifyify transforms to minify the bundles. And let's give the bundles a .bundled.min.js suffix.

globify -g uglifyify "lib/**/*-entry-file.js" -w -v -d -o "dist/*.bundled.min.js"

Globify will call watchify (because of the -w option) three times with all of the specified options:

watchify -g uglifyify lib/my-entry-file.js -v -d -o dist/my-entry-file.bundled.min.js
watchify -g uglifyify lib/other-entry-file.js -v -d -o dist/other-entry-file.bundled.min.js
watchify -g uglifyify lib/subdir/another-entry-file.js -v -d -o dist/subdir/another-entry-file.bundled.min.js

Contributing

Contributions, enhancements, and bug-fixes are welcome! Open an issue on GitHub and submit a pull request.

Building/Testing

To build/test the project locally on your computer:

  1. Clone this repo
    git clone https://github.com/JS-DevTools/globify.git

  2. Install dependencies
    npm install

  3. Run the tests
    npm test

License

Globify is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Big Thanks To

Thanks to these awesome companies for their support of Open Source developers

Travis CI SauceLabs Coveralls

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].