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

Web package builder overrides target of tsconfig.lib.json #3601

Closed
scdc opened this issue Aug 25, 2020 · 1 comment · Fixed by #3661
Closed

Web package builder overrides target of tsconfig.lib.json #3601

scdc opened this issue Aug 25, 2020 · 1 comment · Fixed by #3661
Assignees
Labels
outdated scope: react Issues related to React support for Nx type: bug

Comments

@scdc
Copy link

scdc commented Aug 25, 2020

Current Behavior

When building umd module with web package builder, the typescript target config of the library is overriden with 'es5'

Expected Behavior

Nx Package bundler should use target from the tsconfig.lib.json of the library.
It's a regression from Nx 8 where the correct target was used.

Steps to Reproduce

The problem is located in

https://github.com/nrwl/nx/blob/master/packages/web/src/builders/package/package.impl.ts

The target configuration is overridden when configuring the rollup typescript plugin

typescript(
{
        check: true,
        tsconfig: options.tsConfig,
        tsconfigOverride: {
          compilerOptions: {
            rootDir: options.entryRoot,
            allowJs: false,
            declaration: true,
            paths: compilerOptionPaths,
            target: config.format === 'esm' ? 'esnext' : 'es5', // all umd module use es5 target even if tsconfig from the library specifies another target
          },
        },
      }
)
@scdc scdc added the type: bug label Aug 25, 2020
@scdc scdc changed the title Web package builder override target of tsconfig.lib.json Web package builder overrides target of tsconfig.lib.json Aug 26, 2020
@bekos bekos added the scope: react Issues related to React support for Nx label Sep 3, 2020
@mandarini mandarini self-assigned this Sep 3, 2020
mandarini added a commit to mandarini/nx that referenced this issue Sep 4, 2020
@mandarini mandarini linked a pull request Sep 4, 2020 that will close this issue
mandarini added a commit to mandarini/nx that referenced this issue Sep 8, 2020
mandarini added a commit to mandarini/nx that referenced this issue Sep 8, 2020
jaysoo pushed a commit that referenced this issue Sep 14, 2020
* feat(react): wip: initial e2e test by jack and web package builder fix

Updated some commnets about versions of Storybook, extra config files, and how to treat these

* fix(web): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: #3601

* fix(react): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: #3601

* fix(react): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: #3601
vivekmore pushed a commit to vivekmore/nx that referenced this issue Sep 19, 2020
* feat(react): wip: initial e2e test by jack and web package builder fix

Updated some commnets about versions of Storybook, extra config files, and how to treat these

* fix(web): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: nrwl#3601

* fix(react): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: nrwl#3601

* fix(react): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: nrwl#3601
Doginal pushed a commit to Doginal/nx that referenced this issue Nov 25, 2020
* feat(react): wip: initial e2e test by jack and web package builder fix

Updated some commnets about versions of Storybook, extra config files, and how to treat these

* fix(web): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: nrwl#3601

* fix(react): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: nrwl#3601

* fix(react): preserve the target set in tsconfig.lib.json

ISSUES CLOSED: nrwl#3601
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react Issues related to React support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants