Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thipages/jsbuild

Automate js build
https://github.com/thipages/jsbuild

automation babel javascript php rollup terser

Last synced: about 1 month ago
JSON representation

Automate js build

Awesome Lists containing this project

README

        

# jsbuild
Automate js build

## installation
_composer require thipages/jsbuild_

## Usage

1. Create a _jsbuild.json_ file by hand or with this helper

```php
use thipages\jsbuild\JSBuild;
require('./vendor/autotload.php');
JSBuild::writeBuildModel();
```
or execute _php -r "require './vendor/autoload.php';thipages\jsbuild\JSBuild::writeBuildModel();"_

2. Create rollup config files folder and _package.json_ from a _jsbuild.json_ file

```php
use thipages\jsbuild\JSBuild;
require('./vendor/autotload.php');
$builder=new JSBuild();
$builder->writeBuild();
```

3. update _package.json_ dependencies if any

4. Create library entry point as _./esm/index.js_

5. execute _npm install_

6. execute _npm run build_

This will create three root files
- index.js (esm)
- index.min.js (esm minified)
- min.js (iife minified)

Note : php script (point 2) can not be reused (no update process yet)