Document about alternative JS assets installation with npm packages

This commit is contained in:
Hugo Alliaume
2025-03-02 11:43:43 +01:00
parent 550a7dacb3
commit bfc5ab1990
2 changed files with 16 additions and 3 deletions

View File

@@ -1,10 +1,18 @@
# @symfony/ux-cropperjs
Cropper.js integration for Symfony.
JavaScript assets of the [symfony/ux-cropperjs](https://packagist.org/packages/symfony/ux-cropperjs) PHP package.
** Direct installation of this package is for advanced users only.** We strongly recommend installing it through the PHP package [symfony/ux-cropperjs](https://packagist.org/packages/symfony/ux-cropperjs) in a Symfony application with Flex enabled.
## Installation
If you still want to install this package directly, **make sure its version exactly matches [symfony/ux-cropperjs](https://packagist.org/packages/symfony/ux-cropperjs) PHP package version.**
This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.).
We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-cropperjs](https://packagist.org/packages/symfony/ux-cropperjs) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled.
If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-cropperjs](https://packagist.org/packages/symfony/ux-cropperjs) PHP package version:
```shell
composer require symfony/ux-cropperjs:2.23.0
npm add @symfony/ux-cropperjs@2.23.0
```
## Resources

View File

@@ -26,6 +26,10 @@ needed if you're using AssetMapper):
$ npm install --force
$ npm run watch
.. note::
For more complex installation scenarios, you can install the JavaScript assets through the `@symfony/ux-cropperjs npm package`_
Usage
-----
@@ -149,3 +153,4 @@ https://symfony.com/doc/current/contributing/code/bc.html
.. _`the Symfony UX initiative`: https://ux.symfony.com/
.. _`the Cropper.js options`: https://github.com/fengyuanchen/cropperjs/blob/main/README.md#options
.. _StimulusBundle configured in your app: https://symfony.com/bundles/StimulusBundle/current/index.html
.. _`@symfony/ux-cropperjs npm package`: https://www.npmjs.com/package/@symfony/ux-cropperjs