question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

omit dist/_nuxt/img for static build

See original GitHub issue

Is it possible to omit the dist/_nuxt/img directory when running nuxt generate? This directory seems to contain the original images, which in our case amounts to about 2G (we have lots of hirez images). The dist/_nuxt/images dir by contrast is only 87ish MB, and as far as I can tell these images aren’t used in prod.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pkpowellcommented, Jun 5, 2021

Perfect, that worked. Thanks for clearing up webpack/require, I’ve been bitten by that before… Having a “pass thru” option for svgs or even svgo optimisation would be handy, but I can easily live with this solution.

0reactions
danielroecommented, Jun 5, 2021

This may work:

:src="require(`~/assets/uploads/${src.replace('.svg', '')}.svg`)"

This should explain more about what is happening under the hood with webpack.

Finally, if you have preferences on what should happen with svgs, suggestions are welcome…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can somebody explain the difference between the pure static ...
The static build is bigger because it appends all the required shared libraries (like libavfilter and others) into the executable itself. The ...
Read more >
Is this a static build? - Stack Overflow
Yes, if you only want your x265 executable you may delete the header files (and pkg-config file). If you have linked against the...
Read more >
Static Generation / SSG Improvements #9524 - vercel/next.js
These new methods have many advantages over the getInitialProps model as there is a clear distinction between what will become SSG vs SSR....
Read more >
The difference between static and dynamic analysis - Enterfea
We will learn about the differences between statics and dynamics! The main difference between static and dynamic analysis is TIME!
Read more >
How to take full advantage of full-static mode in Nuxt.js 2.13
Let's zoom in on this new full-static mode and explore some ways to harness its power when building your next static app with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found