Skip to content

This package allows you to manage multiple assets with yarn's workspaces feature

License

Notifications You must be signed in to change notification settings

ARCANEDEV/LaravelAssets

Repository files navigation

Laravel Assets Packagist License For Laravel 5

Travis Status Coverage Status Scrutinizer Code Quality SensioLabs Insight Github Issues

Packagist Packagist Release Packagist Downloads

By ARCANEDEV©

This Assets package allows you to structure your assets into multiple workspaces (like frontoffice + backoffice + components + packages…).

IMPORTANT: This package is a helper like php artisan preset built on top of the Yarn's workspaces feature.

Features

  • A very flexible assets management.
  • Easy setup & configuration.
  • Well documented & IDE Friendly.
  • Made with ❤️ & ☕.

Table of contents

  1. Installation and Setup
  2. Configuration
  3. Usage
  4. Extra

Description

This package allows you to generate a structure like this (and it's customizable)

laravel-projet
  |--app
  |--assets
  |  |--laravel (frontoffice with dependencies: bootstrap + jquery + popper.js + vue + axios)
  |  |--admin (backoffice with dependencies: tailwind + vue + axios)
  |  |--alert-component (shared vue component)
  |  ...
  |--config
  ...

The laravel-mix will generate the frontoffice assets [laravel] (css/app.css, js/app.js), same as the backoffice assets [admin] (css/admin.css, js/admin.js).

And both [laravel] and [admin] has their own package.json file (+ their dependencies) and also can re-use the shared component [alert-component] (for example) as a dependency.

For example:

assets/laravel/package.json

{
    "private": true,
    "name": "@assets/laravel",
    "version": "1.0.0",
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "jquery": "^3.2",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.5",
        "popper.js": "^1.12",
        "vue": "^2.5.17",
        "@assets/alert-component": "~1.0.0"
    }
}

assets/laravel/js/app.js

//...

@require('@assets/alert-component');

//...

assets/laravel/sass/app.scss

//...

@require('~@assets/alert-component/sass/style.scss');

//...

Contribution

Any ideas are welcome. Feel free to submit any issues or pull requests, please check the contribution guidelines.

Security

If you discover any security related issues, please email arcanedev.maroc@gmail.com instead of using the issue tracker.

Credits