-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node assets build should occur after composer install #68
Comments
PHP dependencies ( // composer.json
"post-update-cmd": [
...
"@php -r \"copy('vendor/livewire/livewire/dist/livewire.esm', 'resources/js/lib/livewire/livewire.esm');\""
],
// app.js
import { Livewire, Alpine } from './lib/livewire/livewire.esm'; Then, run |
We need to expose vendor directory, this is not actually reliable to copy all dependencies. The ESM module make relative imports like "../alpine/packages/alpinejs/dist/module.cjs.js", we can't copy every single file manually |
Maybe this is a good occasion to work on it along with alpine & bun support as it's on the to-do list and would be a rewrite |
Did this locally for RoadRunner.Alpine.Dockerfile Only caveat that I use --ignore-platform-reqs to just install composer dependencies from lightweight composer image without building whole image with all php extensions etc. Then use it for frontend build and backend steps.
frontend image build
php image build
Full RoadRunner.Alpine.Dockerfile file for example
|
The docker build will fail if any javascript file import a resource from composer vendor folder (e.g Alpine / Livewire)
import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm';
This import is from the Livewire documentation: https://livewire.laravel.com/docs/alpine#manually-bundling-alpine-in-your-javascript-build
The text was updated successfully, but these errors were encountered: