Skip to content
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

allows manifest file to be parameterized #1578

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

robacarp
Copy link
Contributor

@robacarp robacarp commented Sep 17, 2021

Purpose

fixes #1382 - manifest json file is hard coded to be laravel-mix specific.

Description

This patch allows src/app.cr in a generated application to be changed to this:

-# Load the asset manifest in public/mix-manifest.json
-Lucky::AssetHelpers.load_manifest
+Lucky::AssetHelpers.load_manifest "public/mix-manifest.json"

For folks using rollup, parcel, vite, or whatever hot javascript packaging engine suits them, this top level hook for replacing the manifest file is important.

Notably, this doesn't require the change to app.cr so this isn't a breaking change. It just provides an API where non existed before.

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

@stephendolan
Copy link
Member

I love this! Thanks, @robacarp!

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is a great solution. Thanks for knocking this out ❤️

@jwoertink jwoertink merged commit 4c89e12 into luckyframework:master Sep 18, 2021
@robacarp robacarp deleted the manifest-file-name branch September 20, 2021 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Laravel-Mix specific pathname ./public/mix-manifest.json is hardcoded in asset helpers.
3 participants