GithubHelp home page GithubHelp logo

fabiospampinato / minipacco Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 12 KB

A little bundler for resolving dependencies graphs into a single concatenated file.

License: MIT License

JavaScript 12.86% TypeScript 85.76% CSS 1.38%
bundle concat dependencies mini resolve pacco dot graph

minipacco's Introduction

Minipacco

A little bundler for resolving dependencies graphs into a single concatenated file.

Install

npm install -g minipacco

Usage

Overview

This tool reimplements one of the features of the super bloated pacco.

In some sense it's a tiny language-agnostic bundler, it works like this:

  1. It expects an entry-point file, which can be any textual file.
  2. It resolves dependencies from that, recursively, building the dependency graph.
  3. A dependency on another file is defined by putting a special @require ./other_file.js string inside the requiring file, perhaps inside a comment.
  4. Each file can depend on any number of other files, it just has to use multiple of those strings.
  5. After the dependency graph has been built a single output file will be generated which concatenates all files in the graph in the right order.

The utility of this is pretty niche, but for example this is used in Cash as it gets rid of all the overhead associated with modules and it also simplifies the codebase since a million imports and exports statements become unnecessary, basically there are no boundaries between modules, because each file is not a module, and that's pretty nice in some cases, like if each little file you have is supposed to extend some object or interface when imported, like it's the case in Cash.

Bundling

A bundle command is provided for bundling, it just accepts an entry file and outputs the concatenated string.

minipacco bundle src/index.js

Graphing

A graph command is provided for outputting the dot-encoded dependency graph.

minipacco graph src/index.js

License

MIT © Fabio Spampinato

minipacco's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.