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

Add the option of a prefix path #578

Open
TheElegantCoding opened this issue Nov 11, 2023 · 3 comments
Open

Add the option of a prefix path #578

TheElegantCoding opened this issue Nov 11, 2023 · 3 comments

Comments

@TheElegantCoding
Copy link

TheElegantCoding commented Nov 11, 2023

in my vite project, the html compiles whit a default url, this url is generated depending on some environment variables in the project so is a dynamic url

http://localhost:4000/assets/index-awd12431.css

so this CSS file exists in my dist folder but critical can't find the file because it is unable to search for a path with localhost.

so it will be nice to have a prefixPath option, this way it is possible to ignore the prefix and only search for the files in the current path

  generate({
    base: './dist',
    inline: true,
    src: 'index.html',
    extract: true,
    prefixPath: 'http://localhost:4000'
  });

this will omit the http://localhost:4000 part of the import and get this result /assets/index-awd12431.css

@bezoerb
Copy link
Collaborator

bezoerb commented Nov 12, 2023

This might me caused by the extract option. See: bezoerb/inline-critical#310

@TheElegantCoding
Copy link
Author

yes it is the issue

@TheElegantCoding
Copy link
Author

this package has this a long time ago why is not longer supported ?

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