1

I have a website made with NUXT (VUE framework) and when compiling it, it doesn't compress the CSS files, giving me a very long HTML code.

https://www.tiroconarco.link/

I generate the files with a yarn generate, I suppose that I must put something in the configuration files so that it compresses the CSS.

Can you help me?

Thanks

2
  • 1
    The css in your website is its minified version. What do you mean by compressing? Commented Feb 17, 2022 at 9:02
  • Under the commented information of Github, start a code " html{box-sizing:border-box;overflow-y:scroll; ......... " Commented Feb 17, 2022 at 9:14

1 Answer 1

3

Your CSS contents are already compressed by the Nuxt build process. But stylesheets are inlined in your HTML page for performance purpose, to avoid loading another CSS file.

(see default optimization options)

You can extract all your CSS to an external single file by configuration as below:

// nuxt.config.js

export default {
  build: {
    extractCSS: true
  }
}

See more about extractCSS on docs: https://nuxtjs.org/docs/configuration-glossary/configuration-build/#extractcss

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.