nx icon indicating copy to clipboard operation
nx copied to clipboard

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

Open nsbarsukov opened this issue 1 year ago • 3 comments

Reproduction

  1. Create workspace
npx [email protected] --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/[email protected] -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)

  • https://github.com/ezolenko/rollup-plugin-typescript2/issues/446

nsbarsukov avatar Dec 06 '23 14:12 nsbarsukov

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

vercel[bot] avatar Dec 06 '23 14:12 vercel[bot]

Thank you for your contribution! LGTM :tada:

FrozenPandaz avatar Feb 06 '24 16:02 FrozenPandaz

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[bot] avatar Feb 12 '24 00:02 github-actions[bot]