From 97cdba9070e9147f19f2ad4ed0279d6f7e84d37c Mon Sep 17 00:00:00 2001 From: Marko Sandalj Date: Fri, 3 May 2024 19:37:38 +0200 Subject: [PATCH] NGSTACK-870 implement vite for asset bundleing instead of webpack --- .gitignore | 5 + .../js/components/GalleryBlock.component.js | 2 + assets/js/components/PageHeader.component.js | 10 +- assets/sass/style.scss | 3 +- composer.json | 3 +- config/bundles.php | 1 + config/routes/dev/pentatrion_vite.yaml | 3 + package.json | 170 +++-- symfony.lock | 700 ++++++++++++++++++ templates/themes/app/pagelayout.html.twig | 4 +- .../app/pagelayout/head/script.html.twig | 8 +- .../app/pagelayout/head/style.html.twig | 9 +- vite.config.js | 32 + 13 files changed, 849 insertions(+), 101 deletions(-) create mode 100644 config/routes/dev/pentatrion_vite.yaml create mode 100644 vite.config.js diff --git a/.gitignore b/.gitignore index a85a2df90..89f5e37af 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,8 @@ studio.json .phpunit.result.cache /phpunit.xml ###< symfony/phpunit-bridge ### + +###> pentatrion/vite-bundle ### +/node_modules/ +/public/build/ +###< pentatrion/vite-bundle ### diff --git a/assets/js/components/GalleryBlock.component.js b/assets/js/components/GalleryBlock.component.js index 6ad36f994..dfb2dd8ae 100644 --- a/assets/js/components/GalleryBlock.component.js +++ b/assets/js/components/GalleryBlock.component.js @@ -1,4 +1,6 @@ // eslint-disable-next-line import/no-unresolved +import 'photoswipe/style.css'; +// eslint-disable-next-line import/no-unresolved import PhotoSwipeLightbox from 'photoswipe/lightbox'; export default class GalleryBlock { diff --git a/assets/js/components/PageHeader.component.js b/assets/js/components/PageHeader.component.js index f274f5e4e..17db526d6 100644 --- a/assets/js/components/PageHeader.component.js +++ b/assets/js/components/PageHeader.component.js @@ -180,6 +180,7 @@ export default class PageHeader { togglePageClass(classToToggle) { this.pageWrapper.classList.toggle(classToToggle); + } stickyHeaderSetup() { @@ -188,9 +189,12 @@ export default class PageHeader { } ['load', 'scroll', 'resize', 'orientationchange'].forEach((eventType) => { window.addEventListener(eventType, () => { - window.scrollY >= 1 - ? this.stickyHeader.classList.add('site-header-sticky--active') - : this.stickyHeader.classList.remove('site-header-sticky--active'); + if (window.scrollY >= 1) { + this.stickyHeader.classList.add('site-header-sticky--active') + this.stickyHeader.parentElement.style.height = `${this.stickyHeader.offsetHeight}px` + } else { + this.stickyHeader.classList.remove('site-header-sticky--active'); + } }); }); } diff --git a/assets/sass/style.scss b/assets/sass/style.scss index 6f526b014..6cb32e875 100644 --- a/assets/sass/style.scss +++ b/assets/sass/style.scss @@ -3,7 +3,6 @@ // External libraries @import 'swiper/css/bundle'; -@import 'photoswipe/dist/photoswipe'; // Main variables @import 'variables'; @@ -97,4 +96,4 @@ @import 'cookie_control'; // Accessibility -@import 'accessibility'; +@import 'accessibility'; \ No newline at end of file diff --git a/composer.json b/composer.json index 3c21538cf..618c806a0 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,8 @@ "netgen/layouts-ibexa": "~1.4.0", "netgen/layouts-ibexa-site-api": "~1.4.0", "netgen/layouts-ibexa-relation-list-query": "^1.4", - "netgen/layouts-ibexa-tags-query": "^1.4" + "netgen/layouts-ibexa-tags-query": "^1.4", + "pentatrion/vite-bundle": "^6.4" }, "require-dev": { "symfony/debug-bundle": "5.4.*", diff --git a/config/bundles.php b/config/bundles.php index 7dcc19363..21bfd43a2 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -82,4 +82,5 @@ Netgen\IbexaFieldTypeEnhancedLinkBundle\NetgenIbexaFieldTypeEnhancedLinkBundle::class => ['all' => true], Netgen\Bundle\BetterIbexaAdminUIBundle\NetgenBetterIbexaAdminUIBundle::class => ['all' => true], Netgen\Bundle\ToolbarBundle\NetgenToolbarBundle::class => ['all' => true], + Pentatrion\ViteBundle\PentatrionViteBundle::class => ['all' => true], ]; diff --git a/config/routes/dev/pentatrion_vite.yaml b/config/routes/dev/pentatrion_vite.yaml new file mode 100644 index 000000000..736059b58 --- /dev/null +++ b/config/routes/dev/pentatrion_vite.yaml @@ -0,0 +1,3 @@ +_pentatrion_vite: + prefix: /build + resource: "@PentatrionViteBundle/Resources/config/routing.yaml" diff --git a/package.json b/package.json index bf4a0ab5b..19cfb2b46 100644 --- a/package.json +++ b/package.json @@ -1,84 +1,90 @@ { - "browserslist": { - "defaults": [ - "last 2 versions", - "Safari >= 10", - "iOS >= 10", - "not ie <= 10", - "> 1%" - ], - "evergreen": [ - "last 2 Chrome versions", - "last 2 ChromeAndroid versions", - "last 2 Firefox versions", - "last 2 FirefoxAndroid versions", - "last 2 Safari versions", - "last 2 iOS versions", - "last 2 Edge versions", - "last 2 Opera versions" - ] - }, - "scripts": { - "build:dev": "encore dev", - "build:prod": "encore production", - "watch": "encore dev --watch", - "start": "encore dev-server", - "server": "encore dev-server", - "site:dev": "encore dev --config-name", - "site:prod": "encore production --config-name", - "site:watch": "encore dev --watch --config-name", - "site:server": "encore dev-server --config-name", - "ibexa": "encore production --config=webpack.config.ibexa.js", - "format:js": "prettier --write \"assets/js/**/*.js\"", - "linter:js": "eslint \"assets/js/**/*.js\"" - }, - "private": true, - "devDependencies": { - "@babel/core": "^7.4.3", - "@babel/preset-env": "^7.4.3", - "@babel/preset-react": "^7.0.0", - "@babel/runtime": "^7.13.10", - "@ckeditor/ckeditor5-alignment": "^40.1.0", - "@ckeditor/ckeditor5-build-inline": "^40.1.0", - "@ckeditor/ckeditor5-code-block": "^40.1.0", - "@ckeditor/ckeditor5-dev-utils": "^39.0.0", - "@ckeditor/ckeditor5-theme-lark": "^40.1.0", - "@ckeditor/ckeditor5-widget": "^40.1.0", - "@hotwired/stimulus": "^3.0.0", - "@svgr/webpack": "^8.1.0", - "@symfony/stimulus-bridge": "^3.0.0", - "@symfony/webpack-encore": "^3.0.0", - "autoprefixer": "^9.5.1", - "core-js": "^3.0.0", - "eslint": "^8.3.0", - "eslint-config-airbnb": "^19.0.2", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.17.2", - "eslint-plugin-jsx-a11y": "^6.2.1", - "eslint-plugin-react": "^7.12.4", - "eslint-plugin-react-hooks": "^4.3.0", - "file-loader": "^6.0.0", - "path": "^0.12.7", - "postcss-loader": "^4.3.0", - "prettier": "^2.5.0", - "raw-loader": "^4.0.1", - "regenerator-runtime": "^0.13.2", - "sass": "^1.63.4", - "sass-lint": "^1.12.1", - "sass-loader": "^13.0.0", - "style-loader": "^2.0.0", - "webpack-notifier": "^1.6.0" - }, - "dependencies": { - "@netgen/javascript-cookie-control": "^0.0.8", - "@popperjs/core": "^2.11.6", - "bootstrap": "~5.2.1", - "js-cookie": "^3.0.5", - "photoswipe": "^5.3.4", - "popper.js": "^1.15.0", - "swiper": "^11.0.2" - }, - "engines": { - "node": "^18" - } + "browserslist": { + "defaults": [ + "last 2 versions", + "Safari >= 10", + "iOS >= 10", + "not ie <= 10", + "> 1%" + ], + "evergreen": [ + "last 2 Chrome versions", + "last 2 ChromeAndroid versions", + "last 2 Firefox versions", + "last 2 FirefoxAndroid versions", + "last 2 Safari versions", + "last 2 iOS versions", + "last 2 Edge versions", + "last 2 Opera versions" + ] + }, + "scripts": { + "dev": "vite", + "watch": "vite", + "build:dev": "vite build --mode development", + "build:prod": "vite build", + "encore:build:dev": "encore dev", + "encore:build:prod": "encore production", + "encore:watch": "encore dev --watch", + "start": "encore dev-server", + "server": "encore dev-server", + "site:dev": "encore dev --config-name", + "site:prod": "encore production --config-name", + "site:watch": "encore dev --watch --config-name", + "site:server": "encore dev-server --config-name", + "ibexa": "encore production --config=webpack.config.ibexa.js", + "format:js": "prettier --write \"assets/js/**/*.js\"", + "linter:js": "eslint \"assets/js/**/*.js\"" + }, + "private": true, + "devDependencies": { + "@babel/core": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "@babel/preset-react": "^7.0.0", + "@babel/runtime": "^7.13.10", + "@ckeditor/ckeditor5-alignment": "^40.1.0", + "@ckeditor/ckeditor5-build-inline": "^40.1.0", + "@ckeditor/ckeditor5-code-block": "^40.1.0", + "@ckeditor/ckeditor5-dev-utils": "^39.0.0", + "@ckeditor/ckeditor5-theme-lark": "^40.1.0", + "@ckeditor/ckeditor5-widget": "^40.1.0", + "@hotwired/stimulus": "^3.0.0", + "@svgr/webpack": "^8.1.0", + "@symfony/stimulus-bridge": "^3.0.0", + "@symfony/webpack-encore": "^3.0.0", + "autoprefixer": "^9.5.1", + "core-js": "^3.0.0", + "eslint": "^8.3.0", + "eslint-config-airbnb": "^19.0.2", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.17.2", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-react": "^7.12.4", + "eslint-plugin-react-hooks": "^4.3.0", + "file-loader": "^6.0.0", + "path": "^0.12.7", + "postcss-loader": "^4.3.0", + "prettier": "^2.5.0", + "raw-loader": "^4.0.1", + "regenerator-runtime": "^0.13.2", + "sass": "^1.63.4", + "sass-lint": "^1.12.1", + "sass-loader": "^13.0.0", + "style-loader": "^2.0.0", + "webpack-notifier": "^1.6.0" + }, + "dependencies": { + "@netgen/javascript-cookie-control": "^0.0.8", + "@popperjs/core": "^2.11.6", + "bootstrap": "~5.2.1", + "js-cookie": "^3.0.5", + "photoswipe": "^5.4.3", + "popper.js": "^1.15.0", + "swiper": "^11.0.2", + "vite": "^5.2.11", + "vite-plugin-symfony": "^6.4.4" + }, + "engines": { + "node": "^18" + } } diff --git a/symfony.lock b/symfony.lock index 190ee140a..b0a4ad597 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,61 @@ { + "babdev/pagerfanta-bundle": { + "version": "v2.11.0" + }, + "doctrine/annotations": { + "version": "1.14", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "a2759dd6123694c8d901d0ec80006e044c2e6457" + }, + "files": [ + "config/routes/annotations.yaml" + ] + }, + "doctrine/doctrine-bundle": { + "version": "2.7", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.4", + "ref": "91690c0a440faba1a3676256bcca2b4aa9f55b72" + }, + "files": [ + "config/packages/doctrine.yaml", + "src/Entity/.gitignore", + "src/Repository/.gitignore" + ] + }, + "doctrine/doctrine-migrations-bundle": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.1", + "ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33" + }, + "files": [ + "config/packages/doctrine_migrations.yaml", + "migrations/.gitignore" + ] + }, + "friendsofsymfony/http-cache-bundle": { + "version": "2.17.0" + }, + "friendsofsymfony/jsrouting-bundle": { + "version": "2.8", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "2.3", + "ref": "a9f2e49180f75cdc71ae279a929c4b2e0638de84" + }, + "files": [ + "config/routes/fos_js_routing.yaml" + ] + }, "google/recaptcha": { "version": "1.3", "recipe": { @@ -11,6 +68,132 @@ "config/packages/google_recaptcha.yaml" ] }, + "ibexa/admin-ui": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/admin-ui-assets": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/content-forms": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/core": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/core-persistence": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/cron": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/design-engine": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/doctrine-schema": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/fieldtype-matrix": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/fieldtype-query": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/fieldtype-richtext": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/graphql": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/http-cache": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/notifications": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, "ibexa/oss": { "version": "4.6", "recipe": { @@ -80,6 +263,297 @@ "assets/scss/welcome-page.scss" ] }, + "ibexa/rest": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/search": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/solr": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/standard-design": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/system-info": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "ibexa/templated-uri-bundle": { + "version": "v3.3.2.2" + }, + "ibexa/user": { + "version": "4.6", + "recipe": { + "repo": "github.com/ibexa/recipes", + "branch": "master", + "version": "4.6", + "ref": "575fa895eb28f9d0b7e65e02ba9e3bcb16782094" + } + }, + "jms/translation-bundle": { + "version": "1.9.1" + }, + "knplabs/knp-menu-bundle": { + "version": "v3.4.1" + }, + "lexik/jwt-authentication-bundle": { + "version": "2.21", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.5", + "ref": "e9481b233a11ef7e15fe055a2b21fd3ac1aa2bb7" + }, + "files": [ + "config/packages/lexik_jwt_authentication.yaml" + ] + }, + "liip/imagine-bundle": { + "version": "2.12", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.8", + "ref": "d1227d002b70d1a1f941d91845fcd7ac7fbfc929" + }, + "files": [ + "config/packages/liip_imagine.yaml", + "config/routes/liip_imagine.yaml" + ] + }, + "lolautruche/ez-core-extra-bundle": { + "version": "v4.0.0" + }, + "nelmio/cors-bundle": { + "version": "2.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.5", + "ref": "6bea22e6c564fba3a1391615cada1437d0bde39c" + }, + "files": [ + "config/packages/nelmio_cors.yaml" + ] + }, + "netgen/better-ibexa-admin-ui": { + "version": "1.1", + "recipe": { + "repo": "github.com/netgen/recipes", + "branch": "master", + "version": "1.0", + "ref": "777c670c9f717ade773d2fbe642f728d506cfd0a" + }, + "files": [ + "config/routes/netgen_better_ibexa_admin_ui.yaml" + ] + }, + "netgen/birthday-bundle": { + "version": "3.0.0" + }, + "netgen/content-browser": { + "version": "1.4", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "24cb1c72a375ac7d62a4d18961cf06a9879a442c" + }, + "files": [ + "config/routes/netgen_content_browser.yaml" + ] + }, + "netgen/content-browser-ibexa": { + "version": "1.4.2" + }, + "netgen/content-browser-ui": { + "version": "1.4.1" + }, + "netgen/content-type-list-bundle": { + "version": "3.0.0" + }, + "netgen/enhanced-selection-bundle": { + "version": "5.2.0" + }, + "netgen/ibexa-fieldtype-enhanced-link": { + "version": "1.1.2" + }, + "netgen/ibexa-forms-bundle": { + "version": "4.0.1" + }, + "netgen/ibexa-search-extra": { + "version": "3.2.1" + }, + "netgen/ibexa-site-api": { + "version": "6.1.2" + }, + "netgen/information-collection-bundle": { + "version": "3.0", + "recipe": { + "repo": "github.com/netgen/recipes", + "branch": "master", + "version": "3.0", + "ref": "0819df803b5edbe61570eac2329c36c6549ea6cd" + }, + "files": [ + "config/routes/netgen_information_collection.yaml" + ] + }, + "netgen/layouts-core": { + "version": "1.4", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "04428c25df562ffad615d338704213bbabdc3d2e" + }, + "files": [ + "config/routes/netgen_layouts.yaml" + ] + }, + "netgen/layouts-ibexa": { + "version": "1.4", + "recipe": { + "repo": "github.com/netgen-layouts/recipes", + "branch": "master", + "version": "1.3", + "ref": "bf70253f9860428fb6e9f85069643fcfd1d8070b" + }, + "files": [ + "config/routes/netgen_layouts_ibexa.yaml" + ] + }, + "netgen/layouts-ibexa-relation-list-query": { + "version": "1.4.2" + }, + "netgen/layouts-ibexa-site-api": { + "version": "1.4.7" + }, + "netgen/layouts-ibexa-tags-query": { + "version": "1.4.3" + }, + "netgen/layouts-standard": { + "version": "1.4.3" + }, + "netgen/layouts-ui": { + "version": "1.4.5" + }, + "netgen/open-graph-bundle": { + "version": "3.1.1" + }, + "netgen/site-bundle": { + "version": "3.2", + "recipe": { + "repo": "github.com/netgen/recipes", + "branch": "master", + "version": "3.1", + "ref": "b9370dcad28b0aa2865ca0b7c5dab3abddc51ff1" + }, + "files": [ + "config/routes/netgen_site.yaml" + ] + }, + "netgen/site-installer-bundle": { + "version": "3.1.2" + }, + "netgen/siteaccess-routes-bundle": { + "version": "3.0.0" + }, + "netgen/tagsbundle": { + "version": "5.2", + "recipe": { + "repo": "github.com/netgen/recipes", + "branch": "master", + "version": "5.0", + "ref": "f1f63eae68964971718027b760b7e00b95ebc6c8" + }, + "files": [ + "config/routes/netgen_tags.yaml" + ] + }, + "netgen/toolbar": { + "version": "1.0.1" + }, + "oneup/flysystem-bundle": { + "version": "4.12", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "4.0", + "ref": "3ae1b83985e89138f5443bbc2d9b8c074b497d49" + }, + "files": [ + "config/packages/oneup_flysystem.yaml" + ] + }, + "overblog/graphiql-bundle": { + "version": "0.2", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "0.1", + "ref": "96d185c63491cd15c1570f6243ec1808f4462970" + }, + "files": [ + "config/routes/dev/graphiql.yaml" + ] + }, + "overblog/graphql-bundle": { + "version": "0.14", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "0.12", + "ref": "b122f3bfcfc0706c617a74afa8510af4799810f6" + }, + "files": [ + "config/graphql/types/.gitignore", + "config/packages/graphql.yaml", + "config/routes/graphql.yaml" + ] + }, + "pentatrion/vite-bundle": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "4d98e6cbe66f6cd2dadc8375b035c7a1c30100c0" + }, + "files": [ + "config/routes/dev/pentatrion_vite.yaml" + ] + }, "php-cs-fixer/shim": { "version": "3.49", "recipe": { @@ -92,6 +566,18 @@ ".php-cs-fixer.dist.php" ] }, + "php-http/discovery": { + "version": "1.19", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.18", + "ref": "f45b5dd173a27873ab19f5e3180b2f661c21de02" + }, + "files": [ + "config/packages/http_discovery.yaml" + ] + }, "phpstan/phpstan": { "version": "1.10", "recipe": { @@ -118,6 +604,66 @@ "tests/bootstrap.php" ] }, + "sensio/framework-extra-bundle": { + "version": "6.2", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.2", + "ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b" + }, + "files": [ + "config/packages/sensio_framework_extra.yaml" + ] + }, + "sentry/sentry-symfony": { + "version": "4.14", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "4.6", + "ref": "153de5f041f7e8a9c19f3674b800b76be0e6fd90" + }, + "files": [ + "config/packages/sentry.yaml" + ] + }, + "symfony/console": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "1781ff40d8a17d87cf53f8d4cf0c8346ed2bb461" + }, + "files": [ + "bin/console" + ] + }, + "symfony/debug-bundle": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b" + }, + "files": [ + "config/packages/debug.yaml" + ] + }, + "symfony/flex": { + "version": "2.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" + }, + "files": [ + ".env" + ] + }, "symfony/framework-bundle": { "version": "5.4", "recipe": { @@ -137,6 +683,39 @@ "src/Kernel.php" ] }, + "symfony/lock": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.2", + "ref": "8e937ff2b4735d110af1770f242c1107fdab4c8e" + }, + "files": [ + "config/packages/lock.yaml" + ] + }, + "symfony/mailer": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "4.3", + "ref": "df66ee1f226c46f01e85c29c2f7acce0596ba35a" + }, + "files": [ + "config/packages/mailer.yaml" + ] + }, + "symfony/maker-bundle": { + "version": "1.50", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" + } + }, "symfony/messenger": { "version": "5.4", "recipe": { @@ -149,6 +728,45 @@ "config/packages/messenger.yaml" ] }, + "symfony/monolog-bundle": { + "version": "3.10", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.7", + "ref": "aff23899c4440dd995907613c1dd709b6f59503f" + }, + "files": [ + "config/packages/monolog.yaml" + ] + }, + "symfony/notifier": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.0", + "ref": "178877daf79d2dbd62129dd03612cb1a2cb407cc" + }, + "files": [ + "config/packages/notifier.yaml" + ] + }, + "symfony/phpunit-bridge": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "07ce01a897311647520b43d4ddddad9537b99ba6" + }, + "files": [ + ".env.test", + "bin/phpunit", + "phpunit.xml.dist", + "tests/bootstrap.php" + ] + }, "symfony/routing": { "version": "5.4", "recipe": { @@ -162,6 +780,45 @@ "config/routes.yaml" ] }, + "symfony/security-bundle": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "98f1f2b0d635908c2b40f3675da2d23b1a069d30" + }, + "files": [ + "config/packages/security.yaml" + ] + }, + "symfony/swiftmailer-bundle": { + "version": "3.5", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.5", + "ref": "f0b2fccdca2dfd97dc2fd5ad216d5e27c4f895ac" + }, + "files": [ + "config/packages/dev/swiftmailer.yaml", + "config/packages/swiftmailer.yaml", + "config/packages/test/swiftmailer.yaml" + ] + }, + "symfony/translation": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "e28e27f53663cc34f0be2837aba18e3a1bef8e7b" + }, + "files": [ + "config/packages/translation.yaml", + "translations/.gitignore" + ] + }, "symfony/twig-bundle": { "version": "5.4", "recipe": { @@ -175,6 +832,31 @@ "templates/base.html.twig" ] }, + "symfony/validator": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c" + }, + "files": [ + "config/packages/validator.yaml" + ] + }, + "symfony/web-profiler-bundle": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "24bbc3d84ef2f427f82104f766014e799eefcc3e" + }, + "files": [ + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" + ] + }, "symfony/webpack-encore-bundle": { "version": "1.17", "recipe": { @@ -193,5 +875,23 @@ "package.json", "webpack.config.js" ] + }, + "tanoconsulting/ibexa-migration-bundle": { + "version": "1.0.4" + }, + "twig/extra-bundle": { + "version": "v3.9.3" + }, + "willdurand/js-translation-bundle": { + "version": "4.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.0", + "ref": "02b720a49f6d36b44d557e0b18e48bf09e0a8e07" + }, + "files": [ + "config/routes/js_translation.yaml" + ] } } diff --git a/templates/themes/app/pagelayout.html.twig b/templates/themes/app/pagelayout.html.twig index 07b714d45..f7d6a1e81 100644 --- a/templates/themes/app/pagelayout.html.twig +++ b/templates/themes/app/pagelayout.html.twig @@ -39,7 +39,9 @@ {% include '@ibexadesign/pagelayout/accessibility_links.html.twig' %} {% include '@ibexadesign/parts/google_tag_manager_code_noscript.html.twig' %} {% include '@ibexadesign/parts/facebook_api.html.twig' %} -{% include "@NetgenToolbar/ngtoolbar.html.twig" %} +{% include "@NetgenToolbar/ngtoolbar.html.twig" with { + offset_selectors: [".site-header-sticky" , "#page"] +} %}
{% block layout %} diff --git a/templates/themes/app/pagelayout/head/script.html.twig b/templates/themes/app/pagelayout/head/script.html.twig index d8ba1caae..9a2839c8f 100644 --- a/templates/themes/app/pagelayout/head/script.html.twig +++ b/templates/themes/app/pagelayout/head/script.html.twig @@ -1,14 +1,12 @@ {% for src in encore_entry_js_files('index', 'app') %} {% if 'vendor' in src %} - {% else %} - {% endif %} {% endfor %} -{% for src in encore_entry_js_files('index-noncritical', 'app') %} - -{% endfor %} +{{ vite_entry_script_tags('index') }} +{{ vite_entry_script_tags('index-noncritical', { attr: { "defer": true } }) }} + diff --git a/templates/themes/app/pagelayout/head/style.html.twig b/templates/themes/app/pagelayout/head/style.html.twig index 63abbbecb..3534c1d32 100644 --- a/templates/themes/app/pagelayout/head/style.html.twig +++ b/templates/themes/app/pagelayout/head/style.html.twig @@ -2,12 +2,7 @@ -{% for href in encore_entry_css_files('index', 'app') %} - -{% endfor %} - -{% for href in encore_entry_css_files('index-noncritical', 'app') %} - -{% endfor %} +{{ vite_entry_link_tags('index') }} +{{ vite_entry_link_tags('index-noncritical', { attr: { "rel": "prefetch", "as": "style", "onload": "this.onload=null;this.rel='stylesheet';" }}) }} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 000000000..14eb652a2 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,32 @@ +import { defineConfig, loadEnv } from 'vite'; +import symfonyPlugin from 'vite-plugin-symfony'; + +/* if you're using React */ +// import react from '@vitejs/plugin-react'; + + +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), '') + + const siteConfig = { + name: 'default', + buildLocation: env.APP_ENV === 'production' ? 'build' : 'build_dev', + assetsLocation: 'assets', + }; + + return { + plugins: [ + /* react(), // if you're using React */ + symfonyPlugin(), + ], + build: { + outDir: `./public/assets/app/${siteConfig.buildLocation}/`, + rollupOptions: { + input: { + index: `./${siteConfig.assetsLocation}/js/index.js`, + 'index-noncritical': `./${siteConfig.assetsLocation}/js/index-noncritical.js` + }, + } + }, + } +});