Giter Club home page Giter Club logo

libpack's Introduction

libpack

Greenkeeper badge Build Status Dependency License Prettier Node npm version

CLI tool for quickly build your library with zero configuration.

Support:

  • es2015/es2016/es2017/es2018...
  • Flow
  • Typescript
  • React
  • Vue

Installation

npm install @axetroy/libpack -g

Usage

$ libpack --help

   libpack 0.5.2 - Build your library without tears.

   USAGE

     libpack <entry> <output>

   ARGUMENTS

     <entry>       Entry file path      required      default: "./index.js"
     <output>      Output dir path      required      default: "./build/"  

   OPTIONS

     --cwd <cwd>                          Current work dir                                                                              optional
     -w, --watch                          Watch the file change                                                                         optional      default: false
     --server                             Server the file                                                                               optional      default: false
     --target <target>                    Build target, https://webpack.js.org/concepts/targets/                                        optional      default: "web"
     --prepack                            Prepack the Javascript with facebook/prepack                                                  optional      default: false
     --library <library>                  Output library name, default your package.json name field                                     optional
     --libraryTarget <libraryTarget>      Output library target, https://webpack.js.org/configuration/output/#output-librarytarget      optional      default: "umd"
     --externals <externals>              Externals library, eg. "--externals react,react-dom"                                          optional      default: []

   GLOBAL OPTIONS

     -h, --help         Display help
     -V, --version      Display version
     --no-color         Disable colors
     --quiet            Quiet mode - only displays warn and error messages
     -v, --verbose      Verbose mode - will also output debug messages

API

const libpack = require("@axetroy/libpack");

libpack({
  cwd: process.cwd(),
  watch: false,
  entry: "./index.js",
  output: "./build",
  prepack: false,
  library: "my-library-name",
  libraryTarget: "umd",
  externals: [],
  target: "web",
  server: false
})
  .then(function() {
    console.log("build success...");
  })
  .catch(function(err) {
    console.error(err);
  });

Example

libpack ./index.js ./build
libpack ./index.jsx ./build
libpack ./index.ts ./build
libpack ./index.tsx ./build
libpack ./index.vue ./build

Contributing

git clone https://github.com/axetroy/libpack.git
cd ./libpack
npm i
npm test

You can flow Contribute Guide

Contributors


Axetroy

💻 🔌 ⚠️ 🐛 🎨

License

The MIT License

libpack's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libpack's Issues

An in-range update of conventional-changelog-cli is breaking the build 🚨

Version 1.3.12 of conventional-changelog-cli was just published.

Branch Build failing 🚨
Dependency conventional-changelog-cli
Current Version 1.3.10
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

conventional-changelog-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

v1.0.0

  • Testable
  • Upgrade webpack
  • No need to create tsconfig.json
  • Intelligent identification optional dependencies with package.json's peerDependencies
  • Intelligently identify the output environment, web/node
  • Support loaders
    • sass
    • less
    • scss
    • poscss
    • raw
    • image
    • Auto generate d.ts file when pack typescript.
  • More friendly CLI
  • Remove Prepack
  • Dynamic install loader, for example: node-sass, don't need to install all dependencies when install

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.