How should we reduce the number of files generated by nuxt generate?

Viewed 186

We generate our Jamstack site with nuxt generate and deploy to Cloudflare. Going Full Static. However we have a problem with frequent failures to deploy to Cloudflare. We contacted Cloudflare and were told we had too many deploy files.

So we want to reduce the number of files generated by nuxt generate. How can we configure our settings to reduce the number of files generated? For example, is there a setting that combines some of the generated files into one?

Initially, we tried to reduce the file size and display it more quickly. However, as it is now, deployments fail and information is not updated. We are now willing to sacrifice a little file size and display speed in order to always provide the latest information.

We have not added any special settings. Part of nuxt.config.js is as follows.

export default {
  target: 'static',

  build: {
    html: {
      minify: {
        collapseBooleanAttributes: true,
        decodeEntities: true,
        minifyCSS: false,
        minifyJS: false,
        processConditionalComments: true,
        removeEmptyAttributes: true,
        removeRedundantAttributes: true,
        trimCustomFragments: true,
        useShortDoctype: true,
      },
    },
  },

  generate: {
    subFolders: false,
  },
}

We tried the following settings to no avail.

export default {
   splitChunks: {
      layouts: false,
      pages: false,
      commons: false
   }
}
0 Answers
Related