Coder Social home page Coder Social logo

nuxt-generate-cluster's Introduction

Multi-threaded generate command for Nuxt.js

Build Status Windows Build Status Coverage Status npm npm (scoped with tag)

Use multiple workers to generate the static files for your Nuxt.js project

Setup

Install the package

yarn add nuxt-generate-cluster

Add a generate script to your package.json

  "scripts": {
    "generate": "nuxt-generate -w 4"
  }

Nuxt config options

Configure the generate options in nuxt.config.js

  generate: {
    workers: 4,
    workerConcurrency: 500,
    concurrency: 500,
    routes (callback, params) {
      return axios.get('https://api.example.com/routes?since=' + params.lastFinished)
      .then((res) => {
        return res.data
      })
    },
    done ({ duration, errors, workerInfo }) {
      if (errors.length) {
        axios.post('https://api.example.com/routes', { generate_errors: errors })
      }
    }
  }

workers

  • Default: number of processors

The number of workers that should be started. It probably has no use to start more workers then number of processors in your system.

workerConcurrency

  • Default: 500

To even the load between workers they are sent batches of routes to generate, otherwise a worker with 'easy' routes might finish long before others. Workers will also still use the concurrency option from Nuxt.

routes

The default Nuxt.js routes method has been extended so you can pass additional parameters to it, see params parameter in example config under Setup. By default it will list 3 timestamps:

  • lastStarted The unix timestamp when the nuxt-generate command was last executed, should be just now

  • lastBuilt The unix timestamp when the nuxt project was last built by nuxt-generate

  • lastFinished The unix timestamp when nuxt-generate last finished succesfully (eg not interrupted by ctrl+c)

Timestamps are locally stored in ~/.data-store/nuxt-generate-cluster.json, see data-store

beforeWorkers

This method is called on the master just before the workers are started/forked. It receives the Nuxt options as first argument.

Use this method if you experience serialization issues or when your Nuxt config is too big. The Nuxt options are stringified and then passed as environment variable to the workers, on Windows there seems to be a maximum size of 32KB for env variables.

Properties which should be safe to remove are (not a complete list):

  • buildModules (and their options)
  • serverMiddleware

done

This method will be called when all workers are finished, it receives two arguments:

  • The first argument is an object with statistics:

    • duration The total time in seconds that the command ran

    • errors An array of all the errors that were encountered. Errors can have type handled or unhandled, for the latter the error message will contain the stacktrace

    [ { type: 'handled',
        route: '/non-existing-link',
        error:
         { statusCode: 404,
           message: 'The message from your 404 page' } }
    ]
    • workerInfo An object with detailed information about each worker. Data passed is from the watchdog object that we use internally to monitor the worker status.
    {{ '6707':                            // the process id of the worker
       { start: [ 1929158, 859524606 ],   // process.hrtime the worker was started
         duration: 109567,                // how long the worker was active
         signal: 0,                       // the signal by which the worker was killed (if any)
         code: 0,                         // the exit status of the worker
         routes: 73,                      // the number of routes generated by this worker
         errors: [] },                    // the errors this worker encountered, errors of all workers
                                          // combined is the error argument above
    }
  • The second argument is the Nuxt instance

Command-line options

Please note that you need to explicitly indicate with -b that you want to (re-)build your project

$ ./node_modules/.bin/nuxt-generate -h

  Multi-threaded generate for nuxt using cluster

  Description
    Generate a static web application (server-rendered)
  Usage
    $ nuxt-generate <dir>
  Options
    -b, --build           Whether to (re-)build the nuxt project
    -c, --config-file     Path to Nuxt.js config file (default: nuxt.config.js)
    -h, --help            Displays this message
    -p, --params          Extra parameters which should be passed to routes method
                            (should be a JSON string or queryString)
    -q, --quiet           Decrease verbosity (repeat to decrease more)
    -v, --verbose         Increase verbosity (repeat to increase more)
    --fail-on-page-error  Immediately exit when a page throws an unhandled error
    -w, --workers [NUM]   How many workers should be started
                            (default: # cpus)
    -wc [NUM],            How many routes should be sent to
    --worker-concurrency [NUM]    a worker per iteration

If you need to have more control which routes should be generated, use the -p option to pass additional parameters to your routes method.

# nuxt.config.js
generate: {
  routes (callback, params) {
    console.log(params)
  }
}

$ nuxt-generate -w 2 -p id=1&id=2
// will print =>
{ id: [ '1', '2' ],
  lastStarted: 1508609323,
  lastBuilt: 0,
  lastFinished: 0 }

If you are using a npm script under bash use -- to pass the parameters to nuxt-generate instead of npm:

$ npm run generate -- -p '{ "id": [1,2,3] }'
// will print =>
{ id: [ 1, 2, 3 ],
  lastStarted: 1508786574,
  lastBuilt: 0,
  lastFinished: 0 }

Logging

You can use multiple -v or -q on the command-line to increase or decrease verbosity. We use consola for logging and set a default log level of 3 unless DEBUG is set, then its 5. If you want to log debug messages without setting DEBUG you can use -vv on the command-line

The difference between log levels 2, 3 and 4 are:

  • Level 2 (-q) Only print master messages like worker started / exited. No worker messages.

  • Level 3 Also print which routes the workers generated

  • Level 4 (-v) Also print how much time the route generation took and messages between master and workers

nuxt-generate-cluster's People

Contributors

njam avatar pimlie avatar yoshithechinchilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nuxt-generate-cluster's Issues

[Question] Generating static sites on-demand with Nuxt.js

Cross-post from nuxt.js/issues/#2370 but this repo also seems applicable…


Hi, I'm trying to create a static-site on-demand API using hapi.js to power the API & nuxt.js as the static-site generator but hitting some blockers….

Here's my setup:

  1. The API takes a POST payload
  2. Based on the payload the API dynamically creates the generate.routes array (passing payloads in for each route)
  3. Calls generate() to create the static site in ./dist

Issue:

This API is potentially going to be hammered - building a lot of individual content pages and pushing them to S3 buckets. All generated sites going to the ./dist directory is a problem - I currently have an isGenerating flag to prevent multiple generate calls, forcing the client to re-try the API.

  1. Is using Nuxt as a static-site generator on-demand a ridiculous idea?
  2. If (hopefully) not, are there ways of managing the output better. Potentially streaming straight to an S3 bucket?
  3. Should the generator be able to handle parallel builds?

Thanks in advance,
James

This question is available on Nuxt.js community (#c2)

Automatically follow links and download content?

I have a lot of links like /api/content/[content_id].[content_type] (images and pdfs in my case) which fetch binary files from the API. Currently this content is served dynamically along with generated static app. I want to automatically download it and save to, say, /static folder during the generation process.

Do I have to write a function for that which manually replicates the file structure in order to do that and then run it at some of the build hooks (and then proxying /api/content URLs into /static when serving), or is there at least a theoretical way to retrieve all these links during generation and make Node follow them, download and store the files mimicking the original url while rewriting the links in the process?

If what I want is theoretically possible, but cannot be implemented right now with some configuration, I might consider digging into this and possibly making a PR at some point in case the idea makes sense.

ERROR Could not resolve routes, WARN No routes so not starting workers

How to use this with an existing working (too slowly so I'm trying to speed things up) setup for regular nuxt generate? What should I pass to routes here?

nuxt.config.js:

const axios = Axios.create({
  baseURL: process.env.API_URL
})

module.exports = {
  <...>
  generate: {
    workers: 8,
    async routes() {
      const [
        { data: authors },
        { data: yearsIssues },
        { data: issues },
        { data: articles }
      ] = await Promise.all([
        axios.get(`/all_authors_contribution`),
        axios.get(`/all_issues_by_year`),
        axios.get(`/all_issues`),
        axios.get(`/articles`)
      ])
      const authorsRoutes = authors.map(entry => ({
        route: `/authors/${entry.author.author_id}`,
        payload: entry
      }))
      const yearsRoutes = yearsIssues.map(yearIssues => ({
        route: `/archive/${yearIssues.year}`,
        payload: yearIssues.issues
      }))
      const issuesRoutes = issues.map(issue => ({
        route: `/archive/${issue.feature || issue.year}/${issue.order_within_year}`,
        payload: issue
      }))
      const articlesRoutes = articles
        .filter(article => !!article.issue)
        .map(article => ({
          route: `/archive/${article.issue.feature || article.issue.year}/${article.issue.order_within_year}/${article.section.order_within_issue}/${article.order_within_section}`,
          payload: article
        }))
      return [
        ...authorsRoutes,
        ...yearsRoutes,
        ...issuesRoutes,
        ...articlesRoutes
      ]
    },
    <...>
  }
}
This question is available on Nuxt community (#c15)

ESM package is missing

Please add esm package as a devDependency, otherwise nuxt-generate-cluster is not working with Nuxt 2.15.2.

Doesn't work with the sitemap module

My sitemap isn't being generated after switching to generate cluster. Is it because this module doesn't emit the generate:done event that the sitemap module listens to?

  // On "generate" mode, generate static files for each sitemap or sitemapindex
  nuxtInstance.nuxt.hook('generate:done', async () => {
    logger.info('Generating sitemaps')
    await Promise.all(options.map((options) => generateSitemaps(options, globalCache, nuxtInstance)))
  })

@nuxt/sitemap not supported?

Hi! I'm using nuxt-generate-cluster to generate my static site (nuxt-generate -b).
Latest version of Nuxt, latest everything.
At the end of my generation, under normal circumstances (i.e. nuxt generate), my sitemap gets generated. Great!
However, with nuxt-generate-cluster, this doesn't seem to happen. Is there any way I can manually generate the sitemap, or add a hook the end of this other generate function?

nuxt.config.js:

...
modules: [
    'nuxt-i18n',
    '@nuxtjs/feed',
    '@nuxtjs/sitemap',
  ],
...
  generate: {
    dir: './docs',
    fallback: '404.html',
    workers: 4,
    workerConcurrency: 20,
    concurrency: 20,
    routes: () => {...}
  },
...
This question is available on Nuxt community (#c11)

Assertion failed: len < MAX_ENV_VAR_LENGTH

The master sends the nuxt.config through an env var to the worker. On windows there appears to be a limit of passing env vars of 32KB (possibly since node v12.10), if you exceed that limit libuv will throw an error.

Possible fixes:

  • zip the env
  • use disk
This question is available on Nuxt community (#c13)

All workers complete their work and exit but build silently halts

I have trouble with the build/generation not finishing. The process seems to go fine and all workers complete their work and exit but then nothing happens. Maybe everything is done, just that npm doesn't exit the script.

Has anyone else run into this? Any tips for debugging this?

Here is the generate config from nuxt.config.js:

  generate: {
    workers: 4,
    workerConcurrency: 500,
    concurrency: 500,
    routes: function () {
      return axios.get('https://_-redacted-_/wp-json/wp/v2/posts?per_page=100')
      .then((res) => {
        return res.data.map((post) => {
          return '/posts/' + post.slug
        })
      })
    },
    done ({ duration, errors, workerInfo }) {
      if (errors.length) {
        console.log({ generate_errors: errors })
      }
    }
  },

Should we rename this package

@Atinux @pi0

When I created this package I used the name cluster as I thought it didnt matter much as it would be a temporary package anyway. That would leave the option open for you to create a package with similar functionality but with a better name. Now that you accepted this package to the nuxt-community, could/should we maybe rename it to e.g. a more suitable nuxt-multi-generate or nuxt-generator-workers name? (better suggestions are welcome)

Also I implemented a cleaner and extensible producer/consumer design in my next branch. I am not sure yet if using cluster is the best in the long run, eg using process/child_process would be 'cleaner'.
Besides that I am thinking about creating a nuxt-generate-daemon that just runs all the time and will poll every interval the routes api endpoint to check for new routes/files to (re)generate. So instead of running this package in a crontab. As I will probably need different type of workers for that I am not sure yet cluster will be sufficient for that. With the new implementation we should be able to easily extend and implement process/subprocess if needed.

So maybe it would be an idea to remove the cluster part from this package name now the impact of that would be still small as there are not many users yet?

This question is available on Nuxt.js community (#c1)

Get static routes automatically like with the regular nuxt generate command

I would like to use nuxt-generate as a replacement for nuxt generate

Unfortunately it generates 0 routes unless I manually define them in the generate.routes option

How can I have it automatically generate all routes based on the files in my pages folders the way that the original nuxt generate command does (it does not require me to define the routes in the nuxt.config.js file)

This question is available on Nuxt community (#c6)

Nuxt Generator Opening Connections Too Many Files, Hitting Lambda Limits and Getting EMFILE Errors

I am getting the following error message in my Lambda logs
{
"type": "system",
"errno": "EMFILE",
"code": "EMFILE",
"erroredSysCall": "connect"
}

Looking at everything from a bunch of different angles, I am having a problem with the Nuxt Generator. The code is opening files and websocket connections beyond the max limit set by Lambda. The AWS team is telling me that the code needs to initiate all connections, web socket connections etc outside the Lambda Handler. This is because these connections can be reused for future invokes. Reference Lambda best practices in the body of the AWS support advice below. Please see the reference they sent me.

[2] Best practices for working with AWS Lambda functions - https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html

In addition to the connections being commingled with the files, the handler is leaving the files open and not closing them when it is done doing what it needs to do. So I am being told that I should follow best practices today and they are recommending that all connections are made outside the handler and then reused. Connections that can be reused between invokes and should be.

The code should instruct the handler to close each file when it finishes with what it is instructed to do. If you open a file inside of Lambda, you need to be sure that it is closed before you open a new file.

I am having problems with generator and how to make sure that I am sticking to the hard limits set by AWS Lambda policy.

Can someone help me fix the handler code to separate the connections from the files and open and close each of the files as they are being used?

[1] Lambda quotas - Function configuration, deployment, and execution - https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#function-configuration-deployment-and-execution

This is from AWS directly:

To briefly summaries our conversation, you are still receiving the EMFILE issue on your Lambda function. As explained, this is due to 1,024 limit of open files and connections on your Lambda function. We discussed best practices for your Lambda function where you would initiate connections outside of the handler and reuse them as well as closing each file after you open it. This will resolve your issue of reaching the 1,024 limit.

Also on the call I examined your log file and could see that the Lambda function seemed to have some error handling built into the code as it was able to continue executing even with the errors, however it was still receiving an error due to timeouts. To help try to resolve this we increased the timeout to 5 minutes. This timeout may need to be adjusted further depending on the time it takes for you to also close the files, however 5 minutes I would suspect is adequate for your function.

I did note that I had encountered a similar issue recently in a case and I could send you on the resources I had there. There is a useful 3rd party resource that covers both errors (EMFILE and /tmp storage) you have faced and talks about resolving them, it is also in javascript, which is useful as your Lambda is using node.js [3].

Finally, to summarize this case, I am recommending that you are obeying Lambda best practices [2] by closing every file on your Lambda function after it has been read. This will ensure you no longer receive the EMFILE error.

Error: Renderer resources are not loaded

Error: Renderer resources are not loaded! Please check possible console errors and ensure dist ([MY PROJECT]/.nuxt/dist/server) exists.
    at VueRenderer.renderRoute ([MY PROJECT]/node_modules/@nuxt/vue-renderer/dist/vue-renderer.js:4440:17)
    at VueRenderer.renderRoute ([MY PROJECT]/node_modules/@nuxt/vue-renderer/dist/vue-renderer.js:4428:21)

I keep getting these errors for my dynamic route generation. I'm not running anything specifically for nuxt-generate-cluster in my config. This is straight out of the box with my routes function updated to receive callback and params. The command within my package.json is nuxt-generate -w 4 -q

Any ideas on what it is I'm doing wrong? Thanks!

Tips to ensure generate process is using all of its resources

How can I verify that the nuxt generate process is running at it's maximum resources?

Currently testing build times on a DigitalOcean server: CPU-Optimized / 8 GB / 4 vCPUs in nuxt.config.js I have set it to be 6 workers.

When running a build the load-average is around 2.27, 2.0, 1.36 and threads is around 2-4 running simultaneously, mostly only 2 though.

I am really interesting in know if we're using all the resources that we have at the DO server, and if not, how we can increase the effectivity of the generate process. Currently it takes around 35-40 minutes to perform a build.

Error: spawn E2BIG is occurred

Hi!
"Error: spawn E2BIG" is occurred when I do "nuxt-generate -w 4 -b"
I will generate 2864 routes.

Should I set other option?

This question is available on Nuxt community (#c12)

Easy way to make the CLI script fail on any errors

What problem does this feature solve?

When using nuxt-generate-cluster in CI it's crucial to detect errors to be able to abort the build process. Otherwise corrupt builds can get deployed.

Currently the CLI script exits with code 0 in many error cases, which makes it difficult to detect that something went wrong.

For example, when a worker process is killed due to hitting NodeJS's memory limit with signal SIGBART, the 'nuxt-generate' script exits with code 0.

$ NODE_OPTIONS=--max-old-space-size=200 nuxt-generate -w1
[...]
✔ generated: /de/events/basel/2019-01-26/5a97ec47-aef9-422c-a75f-db35429a6d84/index.html                                worker 1 18:50:44
✔ generated: /en/events/basel/2019-01-26/5a97ec47-aef9-422c-a75f-db35429a6d84/index.html                                worker 1 18:50:44
✔ generated: /fr/events/basel/2019-01-26/457c9d63-eec8-47b3-9c73-9ffcf5029797/index.html                                worker 1 18:50:44

<--- Last few GCs --->

[26057:0x55c3494ad3b0]     8054 ms: Mark-sweep 189.6 (213.7) -> 182.0 (214.2) MB, 35.8 / 0.0 ms  (average mu = 0.389, current mu = 0.391) allocation failure scavenge might not succeed
[26057:0x55c3494ad3b0]     8113 ms: Mark-sweep 189.8 (214.2) -> 182.2 (214.7) MB, 34.7 / 0.0 ms  (average mu = 0.396, current mu = 0.403) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1b9474ddbe1d]
Security context: 0x14ef8771e6e1 <JSObject>
    1: push [0x14ef87705851](this=0x024697cbac39 <JSArray[0]>,0x2534143843c9 <String[1]: ->)
    2: intoTokens [0x1f14ee734521] [/home/njam/Repos/denkmal-website/node_modules/clean-css/lib/tokenizer/tokenize.js:~80] [pc=0x1b94751efc0e](this=0x2290dd79ad11 <JSGlobal Object>,source=0x024697c85b41 <Very long string[1648]>,externalContext=0x024697c86261 <Object ...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x55c348323f21 node::Abort() [/usr/bin/node]
 2: 0x55c348323f6f  [/usr/bin/node]
 3: 0x55c3484d87f2 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 4: 0x55c3484d8a4b v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 5: 0x55c34886d283  [/usr/bin/node]
 6: 0x55c34886d3c4  [/usr/bin/node]
 7: 0x55c34887d043 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node]
 8: 0x55c34887d9c9 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
 9: 0x55c34887fadd v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node]
10: 0x55c34887fb32 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node]
11: 0x55c34884dcd5 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/bin/node]
12: 0x55c348ac028f v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
13: 0x1b9474ddbe1d
ℹ worker 1 exited with status code null by signal SIGABRT                                                                 master 18:50:46
HTML Files generated in 22.5s

$ echo $?
0

What does the proposed changes look like?

I would suggest to make the script exit with code 1 on:

  • Any worker exited with a code other than 0, or got killed
  • Any unhandled rendering errors

@pimlie wdyt?

I think the current behaviour (exit 0 even on critical errors) is quite unexpected. But changing it ofc is a breaking change. Not sure what your policy is?

If you think it makes sense, then I would be happy to prepare a PR

This feature request is available on Nuxt community (#c9)

Getting error: manifest.js Not Found when generating

Hello,
We are having a big issue with the package.
We are trying to update our project to the latest Nuxt version (2.15.8) using Nuxt-generate-cluster to speed up the generation process (we have been using it for years now).

The generation process succeeds and the htmls are created, but when testing them running nuxt start (or other server like live-server ) the generated pages complain that the manifest.js for them is not found and break the project:

GET http://localhost:3000/_nuxt/static/1642503716/manifest.js net::ERR_ABORTED 404 (Not Found)

We have tried using Nuxt's native generation, to see if the problem is also there. But when using it the project works well.

I'll try to share some basic config information about the project, and I can try expand if this is not enough.
We are currently configuring our generation like this:

{
  workers: 12,
  workerConcurrency: 12,
  concurrency: 12,
  fallback: true,
  crawler: false,
  routes,
  beforeWorkers (opts) {
    delete opts.serverMiddleware
    delete opts.redirect
    delete opts.buildModules
  },
  done (_, nuxt) {
    nuxt.callHook('generate:done')
  }
}

And our package looks like this:

{
  "name": "company_site_v5",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "prepare": "husky install",
    "generate": "NUXT_GENERATION_MODE=static nuxt generate",
    "generate:workers": "NUXT_GENERATION_MODE=static nuxt-generate -b",
    "lint:js": "eslint --fix --ext \".js,.vue\" --ignore-path .gitignore .",
    "lint": "npm run lint:js",
    "test": "jest"
  },
  "lint-staged": {
    "*.{js,vue}": "eslint"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "algoliasearch": "^4.12.0",
    "core-js": "^3.15.1",
    "iframe-resizer": "^4.3.2",
    "markdown-it-attrs": "^4.1.3",
    "nuxt": "^2.15.7",
    "nuxt-i18n": "^6.28.1",
    "storyblok-nuxt": "^2.0.1",
    "swiper": "^5.4.5",
    "vue-awesome-swiper": "^4.1.1",
    "vue-cookie": "^1.1.4",
    "vue-instantsearch": "^2.7.1",
    "vue-scrollactive": "^0.9.3",
    "vuex": "^3.6.2"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.14.7",
    "@commitlint/cli": "^12.1.4",
    "@commitlint/config-conventional": "^12.1.4",
    "@nuxtjs/eslint-config": "^6.0.1",
    "@nuxtjs/eslint-module": "^3.0.2",
    "@nuxtjs/feed": "^2.0.0",
    "@nuxtjs/markdownit": "^2.0.0",
    "@nuxtjs/moment": "^1.6.1",
    "@nuxtjs/sitemap": "^2.4.0",
    "@vue/test-utils": "^1.2.1",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "^27.0.5",
    "dotenv": "^14.2.0",
    "eslint": "^7.29.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-vue": "^7.12.1",
    "esm": "^3.2.25",
    "husky": "^6.0.0",
    "jest": "^27.0.5",
    "lint-staged": "^12.1.7",
    "marked": "^4.0.10",
    "nuxt-generate-cluster": "^2.7.0",
    "sass": "^1.48.0",
    "sass-loader": "^10.2.1",
    "storyblok-js-client": "^2.5.0",
    "vue-jest": "^3.0.4"
  }
}

Any help with this issue or a workaround will be greatly appreciated, as we are stuck with this for weeks now.

Nuxt build assets not moved from .nuxt to dist folder

Hi!

I'm experiencing an issue with 2.15.6 where all static assets returns 404 on the statically generated version. The issue seems to be caused by the built assets not being moved from the .nuxt folder to the dist folder on nuxt-generate.

The current workaround is to manually move the assets in the done callback, but would it possible to add similar behaviour as the nuxt generate in regards to building and adding the assets to the dist folder before the SSG starts? :-)

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.