Skip to content

Nuxt module: allow customisable projectRoot for Layers #11

Description

@abovedave

We make use of Layers to create a monorepo setup for multiple sites.

The value of nuxt.options.rootDir is reporting the sub-site folder, but our .netlify folder is at the project root, so it would be useful to pass the value into the @netlify/dev config to this location in "shared" layer nuxt.config.ts i.e.,

netlify: {
  projectRoot: './'
}

I believe it's a quick change, I can open a PR if required.

https://github.com/netlify/primitives/blob/26411689aab3b6463620cf46a7f9b79e503ae0bf/packages/nuxt-module/src/module.ts#L54

const module = defineNuxtModule({
-  projectRoot: nuxt.options.rootDir,
+  projectRoot: options.projectRoot || nuxt.options.rootDir,
})

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions