brandcom / cakephp-vite

ViteHelper plugin for CakePHP and Vite JS
19 stars 6 forks source link

The script method should accept string as single parameter #12

Closed bor-attila closed 7 months ago

bor-attila commented 1 year ago

Just a small QoL idea.

This:

$this->ViteScripts->script([
    // files that are entry files during development and that should be served during production
    'files' => [
        'webroot_src/main.ts',
    ],
]);

should be equal with this:

$this->ViteScripts->script('webroot_src/main.ts');

Yay or Nay?

edoardocavazza commented 7 months ago

I personally think it would be very useful.

passchn commented 7 months ago

I don't need this for my personal use case as I am not doing js code splitting via php. Feel free to make a PR :) It would be great if you do the changes for CakePHP4 and 5 and also update the README accordingly.

passchn commented 7 months ago

The changes have now been released as 1.4.0 or 2.4.0 respectively: https://github.com/brandcom/cakephp-vite/releases/tag/v1.4.0 Cake4 https://github.com/brandcom/cakephp-vite/releases/tag/v2.4.0 Cake5