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

feat(bundling): bump rollup-plugin-typescript2 version #20609

Merged
merged 1 commit into from Feb 6, 2024

Conversation

nsbarsukov
Copy link
Contributor

Reproduction

  1. Create workspace
npx create-nx-workspace@17.1.3 --preset=npm --workspaceType=package-based --nxCloud=false bug-demo

cd bug-demo
  1. Create a library
nx g @nx/js:lib maskito --unitTestRunner=none --bundler=tsc --directory=packages/maskito
  1. Install libphonenumber-js
npm i libphonenumber-js
  1. Use libphonenumber-js inside bug-demo/packages/maskito/src/index.ts:
import {MetadataJson} from 'libphonenumber-js/core';

export const debug: MetadataJson | null = null;

Run nx build maskito => Build is successful ✅

  1. Install @nx/rollup
npm i @nx/rollup@17.1.3 -D
  1. Change executor of the library
nx g @nx/rollup:configuration --project=maskito --skipValidation
  1. Run
nx build maskito

It throws error ❌

> nx run maskito:build:production

Bundling maskito...
Error during bundle: Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Bundle failed: maskito

How to check it ?

  1. Use the reproduction above
  2. Add these lines to root package.json
    "overrides": {
        "rollup-plugin-typescript2": "0.35.0"
    },
  1. Run again npm i
  2. Run nx build maskito

Build is successful ✅

Related Issue(s)

Copy link

vercel bot commented Dec 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Feb 6, 2024 1:43pm

package.json Outdated Show resolved Hide resolved
@mandarini mandarini self-assigned this Jan 31, 2024
@mandarini mandarini changed the title fix(rollup): add support for *.d.cts / *.d.mts file types feat(bundling): bump rollup-plugin-typescript2 version Jan 31, 2024
@FrozenPandaz
Copy link
Collaborator

Thank you for your contribution! LGTM 🎉

@mandarini mandarini merged commit fa226c9 into nrwl:master Feb 6, 2024
6 checks passed
FrozenPandaz pushed a commit that referenced this pull request Feb 7, 2024
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants