Git Product home page Git Product logo

Comments (3)

sambedingfield avatar sambedingfield commented on June 12, 2024 2

Wow, that was a wild goose chase and completely unrelated to Windi or Vue CLI

🙃

After removing all the Windi @apply content- it exposed that Google font import as the last remaining syntax error.
Turns out Webpack doesn't like those semicolons between font weights.
webpack/webpack#10873

This works fine during npm run serve and npm run lint but fails during npm run build

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

Fixed with using an alternative Google font URL (css instead of css2, removing wght@ and ; becomes ,)

@import url('https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700&display=swap');

(and a lot of swearing)

from vue-cli-plugin-windicss.

sambedingfield avatar sambedingfield commented on June 12, 2024 1

Good recommendation! Thanks.

Replaced @import with the standard Google <link> to src/public/index.html.

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">

from vue-cli-plugin-windicss.

harlan-zw avatar harlan-zw commented on June 12, 2024

Oh that's weird! Thanks for the issue and explanation @sambedingfield

Can I recommend you go with the css2 font but add the import in your HML instead of the CSS. HTML is preferred because you're adding an extra network step to fetch the fonts inside the CS, which will decrease the CLS and LCP performance metrics

from vue-cli-plugin-windicss.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.