fix: use vite-plugin-symfony Stimulus loader and wrap react_component in div
The @symfony/stimulus-bundle loader generates an empty controllers.js, so Stimulus controllers from controllers.json (including ux-react) were never registered. Switching to vite-plugin-symfony/stimulus/helpers uses the virtual:symfony/controllers module that properly reads controllers.json. Also wrap react_component() output in a <div> since it only renders data-attributes, not a full HTML element. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,14 @@ ENV APP_ENV=dev \
|
||||
POSTGRES_USER=app \
|
||||
POSTGRES_PASSWORD=pwd
|
||||
|
||||
###
|
||||
# Composer install stage (provides vendor assets for node build)
|
||||
###
|
||||
FROM base AS composer-deps
|
||||
|
||||
COPY composer.json composer.lock symfony.lock ./
|
||||
RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist
|
||||
|
||||
###
|
||||
# Node build stage (for prod assets)
|
||||
###
|
||||
@@ -37,6 +45,9 @@ FROM node:22-alpine AS node-build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy vendor UX assets so npm can resolve file: dependencies
|
||||
COPY --from=composer-deps /app/vendor/symfony/ux-react/assets vendor/symfony/ux-react/assets
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install
|
||||
|
||||
|
||||
Reference in New Issue
Block a user