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

Can't change paths for all folders of nuxt and nitro #15076

Closed
n4an opened this issue Oct 3, 2022 · 5 comments · Fixed by nuxt/framework#7981
Closed

Can't change paths for all folders of nuxt and nitro #15076

n4an opened this issue Oct 3, 2022 · 5 comments · Fixed by nuxt/framework#7981

Comments

@n4an
Copy link

n4an commented Oct 3, 2022

Environment


Reproduction

https://github.com/n4an/nuxt_dirs


export default defineNuxtConfig({
  pages: 'api',
  // plugins: ['~/plugins/client/'],
  // middleware: ['~/middleware/client/'],
  imports: {
  	dir: [
  	  '~/plugins/client/',
         '~/middleware/client/',
  	  '~/server/middleware/',
  	  '~/server/plugins/'
  	]
  },
  nitro: {
  	imports: {
	  	dir: [
                  //  '~/plugins/server/',
	  	  // '~/middleware/server/',
	  	  '~/server/middleware/',
	  	  '~/server/plugins/'
	  	]
	  },
  	middleware: ['~/server/middleware/'],
  	plugins: ['~/server/plugins/'],
  	rootDir: '~/',
  	scanDirs: ['~/components/']
  }
})

Need to change all path to custom values for Nuxt pages, plugins, middlewares and nitro api, plugins, middlewares.
Some are hard coded? Some can be changed but produce errors with auto import.

is imported by virtual:#internal/nitro/virtual/plugins, but could not be resolved – treating it as an external dependency

Describe the bug


Additional context

No response

Logs

No response

@manniL
Copy link
Member

manniL commented Oct 3, 2022

Hey 👋
Could you kindly add a reproduction (e.g. via StackBlitz, see https://nuxt.new/)?

@danielroe
Copy link
Member

You can configure most internal nuxt directories with dir.pages, dir.middleware, etc. Is there any specific directory you are having trouble with configuring?

Copy link
Member

Let's track nitro directories in the separate issue you already opened there: unjs/nitro#541. In general, no need to open duplicate issues across repositories maintained by the same people.

Here's a stackblitz showing how to configure the dirs: https://stackblitz.com/edit/github-cgrw9y.

The only Nuxt directory you mentioned that isn't configurable is plugins and I've opened a PR to do that.

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

Successfully merging a pull request may close this issue.

3 participants