PHPackages                             illuminatech/override-build - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. illuminatech/override-build

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

illuminatech/override-build
===========================

Allows re-building materials from 3rd party libraries with patch

1.1.7(1mo ago)83.3kBSD-3-ClausePHPCI failing

Since Jul 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/illuminatech/override-build)[ Packagist](https://packagist.org/packages/illuminatech/override-build)[ GitHub Sponsors](https://github.com/klimov-paul)[ Patreon](https://www.patreon.com/klimov_paul)[ RSS](/packages/illuminatech-override-build/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (12)Versions (10)Used By (0)

 [ ![](https://avatars1.githubusercontent.com/u/47185924) ](https://github.com/illuminatech)

Laravel Materials Build Override
================================

[](#laravel-materials-build-override)

This extension allows re-building materials from 3rd party libraries with patch.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/99b9b8c8c2fc32ba3504fc4df0ee4583942ea4dc948bf61a117b359bec98f869/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6c756d696e61746563682f6f766572726964652d6275696c642e737667)](https://packagist.org/packages/illuminatech/override-build)[![Total Downloads](https://camo.githubusercontent.com/08b124f8e2066e15fc8d6850ce159485b6438b27dbfcbedc796f3ded889a4ecf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c6c756d696e61746563682f6f766572726964652d6275696c642e737667)](https://packagist.org/packages/illuminatech/override-build)[![Build Status](https://github.com/illuminatech/override-build/workflows/build/badge.svg)](https://github.com/illuminatech/override-build/actions)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist illuminatech/override-build

```

or add

```
"illuminatech/override-build": "*"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

This extension allows re-building materials from 3rd party libraries with patch. It might be in handy while using some extension, which is shipped with already compiled JavaScript files, which you need to modify and thus re-compile. For example: extensions for 3rd party CMS like [Nova](https://nova.laravel.com/).

We can take [froala/nova-froala-field](https://github.com/froala/nova-froala-field) for example. This package is shipped with JavaScript WYSIWYG editor integrated into VueJS component, which are compiled altogether into a single '\*.js' file. In case you need to apply [custom plugin](https://www.froala.com/wysiwyg-editor/docs/concepts/custom/button) to the editor, it becomes impossible unless you re-compile the extension with your own changes.

At this stage it might be tempting to simply adjust source files inside 'vendor/froala/nova-froala-field' directory and run NPM build from there. However any manual changes inside the 'vendor' directory will cause you problems in the future. The patch you create in this way can not be tracked by VCS and you will have to re-apply it in case you update the library. Also any changes made to the files in "vendor" directory may cause Composer fail on 'install' or 'update' command.

This package was created to solve the problem. It allows creating new build (compilation) from particular source files under the different path. This task is performed in following steps:

- Copy source files, which are out of VCS control, to the new 'build' directory.
- Append/override copied files using ones from 'override' directory, which may be under VCS control.
- Apply pre-defined patches, like search-replace or JSON modification, to the created files.
- Run the build/compilation over composed 'build' directory files.

**Heads up!** Actually re-building 3rd party materials in this way is a hack. You should not use it unless you can not achieve your goal using other means.

Application configuration
--------------------------

[](#application-configuration-)

This extension uses [illuminatech/array-factory](https://github.com/illuminatech/array-factory) for configuration. Make sure you are familiar with 'array factory' concept before configuring this extension. Configuration is stored at 'config/override-build.php' file.

You can publish predefined configuration file using following console command:

```
php artisan vendor:publish --provider="Illuminatech\OverrideBuild\OverrideBuildServiceProvider" --tag=config

```

Inside the configuration file you'll have to define the list of packages you wish to re-build. For our 'Froala' example the configuration may look like following:

```
