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

Do not parse tags like <link href="..." rel="preload" as="style"> and <link href="..." rel="preload" as="script"> #241

Open
cromatikap opened this issue Jan 2, 2021 · 1 comment

Comments

@cromatikap
Copy link

Hello,

I want to parse an html file from a vuejs project build:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="icon" href="favicon.ico">
    <title>vue-playground</title>
    <link href="css/app.ef4263c7.css" rel="preload" as="style">
    <link href="js/app.bd8c8303.js" rel="preload" as="script">
    <link href="js/chunk-vendors.52add7a9.js" rel="preload" as="script">
    <link href="css/app.ef4263c7.css" rel="stylesheet">
  </head>
  <body>
    <noscript>
      <strong>
        We're sorry but vue-playground doesn't work properly without JavaScript enabled. Please enable it to continue.
      </strong>
    </noscript>
    <div id="app"></div>
    <script src="js/chunk-vendors.52add7a9.js"></script>
    <script src="js/app.bd8c8303.js"></script>
  </body>
</html>

Is it possible to parse <link href="..." rel="preload" as="style"> (stylesheet) and <link href="..." rel="preload" as="script"> (javascript) in the future? Perhaps I can try a PR on this, what do you think?

@popeindustries
Copy link
Owner

It would certainly be possible. Right now, rel="preload" is skipped only because we only look for "stylesheet" and "icon". I'm not really a fan of "inline everything" (and regret adding that feature), but I'm guessing you can't add the inline attribute because these are generated by Vue? I suppose preload is also a good signal for optimisation.

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