https://github.com/axetroy/libpack
Build your library without tears.:rofl:
https://github.com/axetroy/libpack
configless library packer webpack
Last synced: 11 months ago
JSON representation
Build your library without tears.:rofl:
- Host: GitHub
- URL: https://github.com/axetroy/libpack
- Owner: axetroy
- License: mit
- Created: 2017-04-22T02:48:16.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-11-05T20:47:31.000Z (over 3 years ago)
- Last Synced: 2025-06-22T10:38:59.405Z (about 1 year ago)
- Topics: configless, library, packer, webpack
- Language: JavaScript
- Homepage:
- Size: 194 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# libpack
[](https://greenkeeper.io/)
[](https://travis-ci.org/axetroy/libpack)
[](https://david-dm.org/axetroy/libpack)

[](https://github.com/prettier/prettier)

[](https://badge.fury.io/js/%40axetroy%2Flibpack)
CLI tool for quickly build your library with zero configuration.
Support:
* [x] es2015/es2016/es2017/es2018...
* [x] Flow
* [x] Typescript
* [x] React
* [x] Vue
## Installation
```bash
npm install @axetroy/libpack -g
```
## Usage
```
$ libpack --help
libpack 0.5.2 - Build your library without tears.
USAGE
libpack
ARGUMENTS
Entry file path required default: "./index.js"
Output dir path required default: "./build/"
OPTIONS
--cwd Current work dir optional
-w, --watch Watch the file change optional default: false
--server Server the file optional default: false
--target Build target, https://webpack.js.org/concepts/targets/ optional default: "web"
--prepack Prepack the Javascript with facebook/prepack optional default: false
--library Output library name, default your package.json name field optional
--libraryTarget Output library target, https://webpack.js.org/configuration/output/#output-librarytarget optional default: "umd"
--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
```javascript
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
```bash
libpack ./index.js ./build
libpack ./index.jsx ./build
libpack ./index.ts ./build
libpack ./index.tsx ./build
libpack ./index.vue ./build
```
## Contributing
```bash
git clone https://github.com/axetroy/libpack.git
cd ./libpack
npm i
npm test
```
You can flow [Contribute Guide](https://github.com/axetroy/libpack/blob/master/contributing.md)
## Contributors
| [
Axetroy](http://axetroy.github.io)
[💻](https://github.com/axetroy/libpack/commits?author=axetroy) 🔌 [⚠️](https://github.com/axetroy/libpack/commits?author=axetroy) [🐛](https://github.com/axetroy/libpack/issues?q=author%3Aaxetroy) 🎨 |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
## License
The [MIT License](https://github.com/axetroy/libpack/blob/master/LICENSE)