Enable live components on bootstrap shop (#16709)

| Q               | A
|-----------------|-----
| Branch?         | bootstrap-shop
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | n/a
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.13 branch
 - Features and deprecations must be submitted against the 1.14 branch
- Features, removing deprecations and BC breaks must be submitted
against the 2.0 branch
 - Make sure that the correct base branch is set

To be sure you are not breaking any Backward Compatibilities, check the
documentation:

https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
This commit is contained in:
Rafał Jaskulski 2024-08-14 13:43:42 +02:00 committed by GitHub
commit 20677669b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,20 @@
/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { startStimulusApp } from '@symfony/stimulus-bridge';
import LiveController from '@symfony/ux-live-component';
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.[jt]sx?$/
));
app.register('live', LiveController);

View file

@ -1 +1,14 @@
{}
{
"controllers": {
"@symfony/ux-live-component": {
"live": {
"enabled": true,
"fetch": "eager",
"autoimport": {
"@symfony/ux-live-component/styles/live.css": true
}
}
}
},
"entrypoints": []
}

View file

@ -1,5 +1,6 @@
import './js/app';
import './scss/style.scss';
import './bootstrap';
const imagesContext = require.context('./images', true, /\.(jpg|jpeg|png|svg)$/);
imagesContext.keys().forEach(imagesContext);

View file

@ -4,6 +4,9 @@
"license": "MIT",
"author": "Sylius Sp. z o.o.",
"dependencies": {
"@hotwired/stimulus": "^3.0.0",
"@popperjs/core": "^2.11.8",
"@symfony/stimulus-bridge": "^3.2.2",
"@symfony/webpack-encore": "^3.1.0",
"bootstrap": "^5.3.0"
},