Giter Site home page Giter Site logo

opencollective / fastpack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastpack/fastpack

1.0 3.0 0.0 7.06 MB

Pack JS code fast & easy

Home Page: https://fastpack.sh

License: MIT License

OCaml 60.74% C++ 0.98% Standard ML 3.47% C 0.04% Makefile 0.12% Shell 0.37% Dockerfile 0.19% Perl 1.30% JavaScript 32.62% CSS 0.13% TypeScript 0.02%

fastpack's Introduction

fastpack

Build Status

Pack JS code into a single bundle fast & easy.

Motivation

The goal for fastpack is to provide fast and robust development time bundling for JavaScript applications which scales up to tens of thousands of modules without sacrificing development experience.

We want sub-1000ms bundle time and sub-100ms incremental rebundle time for medium-sized applications (around 1000 modules). We are finally there!

Installation

You can install via npm (or yarn):

% npm i fastpack

Usage

To produce a development bundle:

% fpack --development ./index.js

Please note, bundling in production mode is temporarily disabled. Always use the --development flag for now.

Note that babel, babel-preset-env and uglify-js packages must be installed.

Reference

Run fpack --help to see the available invocation options:

NAME
       fpack - Pack JavaScript code into a single bundle

SYNOPSIS
       fpack COMMAND ...

COMMANDS
       PLEASE NOTE: production mode is temporarily disabled. In the meantime,
       please always use the `--development` flag.

       build
           rebuild the bundle on a file change

       help
           Show this message and exit

       watch
           watch for file changes and rebuild the bundle

       worker
           worker subprocess (do not use directly)

ARGUMENTS
       ENTRY POINTS
           Entry points. Default: ['.']

OPTIONS
       -d, --debug
           Print debug output

       --development
           Build bundle for development

       --dry-run
           Run all the build operations without storing the bundle in the file
           system

       --mock=PACKAGE[:SUBSTITUTE]
           Mock PACKAGE requests with SUBSTITUTE requests. If SUBSTITUTE is
           omitted empty module is used.

       -n NAME, --name=NAME (absent=index.js)
           Output File Name. The target bundle filename will be NAME

       --no-cache
           Do not use cache at all (effective in development mode only)

       --node-modules=PATH, --nm=PATH
           Paths to 'node_modules' directory. Should be inside the project
           directory.. Defaults to ['node_modules']

       -o DIR, --output=DIR (absent=./bundle)
           Output Directory. The target bundle will be DIR/index.js.

       --postprocess=COMMAND
           Apply shell command on a bundle file. The content of the bundle
           will be sent to STDIN and STDOUT output will be collected. If
           multiple commands are specified they will be applied in the order
           of appearance

       --preprocess=PATTERN:PROCESSOR?OPTIONS[!...]
           Preprocess modules matching the PATTERN with the PROCESSOR.
           Optionally, the processor may receive some OPTIONS in form:
           'x=y&a=b'. There are 2 kinds of currently supported processors:
           'builtin' and the Webpack loader. 'builtin' preprocessor provides
           the following transpilers: stripping Flow types, object spread &
           rest operators, class properties (including statics), class/method
           decorators, and React-assumed JSX conversion. 'builtin' may be
           skipped when setting this option, i.e. '\.js$' and '\.js$:builtin'
           are absolutely equal. An example of using the Webpack loader:
           '\.js$:babel-loader?filename=.babelrc'.

       --project-root=PATH (absent=.)
           Ancestor to which node_modules will be resolved.. Defaults to '.'

       --public-path=URL
           URL prefix to download the static assests and JavaScript chunks at
           runtime. Points to the same location as --output-dir.

       --resolve-extension=EXTENSION
           Provide extensions to be considered by the resolver for the
           extension-less path. Extensions will be tried in the specified
           order. If no extension should be tried, provide '' as an argument.
           Defaults to [.js, .json]

       --target=[ app | esm | cjs ] (absent=app)
           Deployment target.

COMMON OPTIONS
       --help[=FMT] (default=auto)
           Show this help in format FMT. The value FMT must be one of `auto',
           `pager', `groff' or `plain'. With `auto', the format is `pager` or
           `plain' whenever the TERM env var is `dumb' or undefined.

       --version
           Show version information.

Development

Make sure you have esy (at least 0.2.8 version) installed:

npm install -g [email protected]

Now install dependencies & build everything:

make bootstrap

Then to produce the executable:

make build

To run tests:

make test
make test-integration

To test compiled executables prepend with esy x:

esy x fpack

As merlin and others live inside sandboxed environment you'd want to execute your editor from inside it:

esy vim
esy nvim
esy vscode
esy sublime

Alternatively you can enter into sandboxed shell:

esy shell

And execute commands from there.

Release Process

The NPM package is built on every commit to the master branch by the Microsoft Azure Pipelines (see Artifacts/fpack). Publishing it on npmjs.org remains manual for now.

fastpack's People

Contributors

andreypopp avatar bryphe avatar exced avatar gilbert avatar jackmac92 avatar ksxgithub avatar rgrinberg avatar samouri avatar trysound avatar ulrikstrid avatar zindel avatar

Stargazers

 avatar

Watchers

 avatar  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.