Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix example changing main file #3495

Closed
wants to merge 2 commits into from
Closed

docs: fix example changing main file #3495

wants to merge 2 commits into from

Conversation

beliolfa
Copy link

In the giving example

  fs.writeFileSync(api.entryFile, contentMain, { encoding: 'utf-8' })

it was being written back the original content instead of the modified lines. I've changed the approach adding the new line to the array and then joining it back.

  lines.splice(renderIndex, 0, `  router,`)
  const newContent = lines.join('\r\n')
  fs.writeFileSync(api.entryFile, newContent, { encoding: 'utf-8' })

@haoqunjiang
Copy link
Member

Thanks for this pull request and sorry for the late reply.
But we found #3656 to be a better fix for this example.
Thanks again though, your help is much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants