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

improve(prodUrl): empty outDir leads to wrong assets path #1

Closed
dennisbaum opened this issue May 17, 2022 · 2 comments
Closed

improve(prodUrl): empty outDir leads to wrong assets path #1

dennisbaum opened this issue May 17, 2022 · 2 comments

Comments

@dennisbaum
Copy link
Contributor

dennisbaum commented May 17, 2022

If i build into the same (public)-directory or in my case the hole site into a dist-folder with the same structure,
i have to config an empty outDir - otherwise no manifest.json will be found nor the assets.

'oblik.vite.build.outDir' => '',

If i do so, it leads to a wrong asset path: ( please note the two slashes

grafik

i would like to filter the path-array to empty strings by strlen.
so the empty outDir wont be included in the array, and the path is correct.

public function prodUrl(string $path)
{
    return implode('/', array_filter([
        site()->url(),
        option('oblik.vite.build.
        $path
    ], 'strlen'));
}

what do you think?
Thx!

@hdodov
Copy link
Contributor

hdodov commented May 18, 2022

Yep, you can do that. That's actually how I made it initially, but thought that having an outDir was conventional, so I thought that I don't need to support it. Feel free to create a PR!

@hdodov
Copy link
Contributor

hdodov commented May 19, 2022

@dennisbaum I published version 1.0.1 on Packagist with the fix. Let me know if everything works fine.

@hdodov hdodov closed this as completed May 19, 2022
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

No branches or pull requests

2 participants