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

Configuration option to customize the pkgDir #49

Open
myabeaver opened this issue Jun 26, 2023 · 4 comments
Open

Configuration option to customize the pkgDir #49

myabeaver opened this issue Jun 26, 2023 · 4 comments

Comments

@myabeaver
Copy link

What version of this package are you using?

What problem do you want to solve?

We use Nx to run our monorepo. Nx has made an adjustment in version 16.3.2 that causes the current working directory to dynamically adjust depending on the project. We are therefore forced to adjust thepkgDir (used to create the basePath) to '.' respectively the current working directory (process.cwd()).

What do you think is the correct solution to this problem?

Add a configuration option to NextConfig, such as nextTranslate. such as:

interface NextConfigWithNextTranslate extends NextConfig {
    nextTranslate?: {
        pkgDir?: string | (() => string);
    }
}

Are you willing to submit a pull request to implement this change?

Yes

@myabeaver myabeaver changed the title Configuration option to customize the basePath Configuration option to customize the pkgDir Jun 26, 2023
@aralroca
Copy link
Owner

We added a env variable for this https://github.com/aralroca/next-translate#13-how-to-use-next-translate-in-a-mono-repo

It should work

@myabeaver
Copy link
Author

@aralroca This is not suitable for our use case since it does not fallback to process.cwd() (require('pkg-dir')) gets resolved.

@aralroca
Copy link
Owner

@myasteiner feel free to PR 👌

@myabeaver
Copy link
Author

@aralroca I've created two PR's:

@aralroca Thank you for your time

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

No branches or pull requests

2 participants