Git Product home page Git Product logo

next-static-image-duplication's Introduction

This is a Next.js project bootstrapped with create-next-app.

To See Issue

npm run build
# or
yarn build

Then look inside the .next folder and you'll see the same quarry image twice.

  • Server: .next\server\chunks\static\image\components\quarry.766f8eca427db5482ce887e319fcde80.png
  • Static: .next\static\image\components\quarry.766f8eca427db5482ce887e319fcde80.png

Problem

The images referenced inside the Server subdirectory aren't used. Images are referenced using the .next\static path. But it gets worse. For people using Vercel to deploy their next apps, the static images can quickly add up and you'll be larger then the 50MB Compressed / 250MB uncompressed requirements as it appears to bundle any image that's used on a SSG page into the .next\server\chunks... location.

Solution

  • A - Ensure that the webpack 5 bundler uses the .next\static route for image assets.
  • B - Provide a flag or configuration parameter to allow user to decide where all image assets go.
  • C - Something else?

next-static-image-duplication's People

Contributors

joerall avatar

Watchers

James Cloos avatar  avatar

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.