Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/thipages/jsbuild
- Owner: thipages
- License: mit
- Created: 2021-03-02T23:38:34.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-08T07:47:13.000Z (almost 4 years ago)
- Last Synced: 2024-12-11T14:47:35.447Z (about 1 month ago)
- Topics: automation, babel, javascript, php, rollup, terser
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)