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

Does not copy the i18n folder to the dist #96

Closed
volbrene opened this issue Feb 25, 2020 · 9 comments
Closed

Does not copy the i18n folder to the dist #96

volbrene opened this issue Feb 25, 2020 · 9 comments

Comments

@volbrene
Copy link

Hello again,
the i18n folder is not moved into the dist folder. Is there any idea why this is the case? My path is src/i18n. Am I missing any extra configurations that are not documented?

When I run "npm run start:dev" the following error occurs:

[Nest] 48830   - 25.02.2020, 16:05:01   [I18nService] failed getting languages +0ms
Error: ENOENT: no such file or directory, scandir '/dist/i18n/'
  • volbrene
@toonvanstrijp
Copy link
Owner

@volbrene of you have a default project (created by the nestjs cli tool) it won't copy those files for you. So you should do this yourself.

I'll add a guide to the readme file how to do this later this week :) (it's not that hard)

2 similar comments
@toonvanstrijp
Copy link
Owner

@volbrene of you have a default project (created by the nestjs cli tool) it won't copy those files for you. So you should do this yourself.

I'll add a guide to the readme file how to do this later this week :) (it's not that hard)

@toonvanstrijp
Copy link
Owner

@volbrene of you have a default project (created by the nestjs cli tool) it won't copy those files for you. So you should do this yourself.

I'll add a guide to the readme file how to do this later this week :) (it's not that hard)

@volbrene
Copy link
Author

Thank you very much :)

@toonvanstrijp
Copy link
Owner

@volbrene If you created your project with the @nestjs/cli you have this file nest-cli.json in the root.

To enable nest to copy the i18n folder you need to have something like this:
nest-cli.json

{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "assets": ["i18n/**/*"]
  }
}

@volbrene
Copy link
Author

Thank you :)

@agile-apoorvdodiya
Copy link

this did not worked with me I am using nestJS version 6

@toonvanstrijpwavy
Copy link
Contributor

@agile-apoorvdodiya I guess nest js version 6 doesn't support this feature yet.

@benripka
Copy link

For me I had to also specify the outDir for where I wanted to place the i18n in dist, incase this helps anyone:

{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "assets": [{ "include": "i18n/**/*", "watchAssets": true, "outDir": "dist/src/" }]
  }
}

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

5 participants