XaveScor / smartbundle

Just code, no config. Zero-config bundler for js libraries
32 stars 0 forks source link

@babel/core included by smartbundle package #104

Closed kravetsone closed 3 days ago

kravetsone commented 5 days ago

Reproduciton

  1. Init new project
npm init
  1. add smartbundle to dev deps
npm i smartbundle -d
  1. check @babel/core in your deps
PS Z:\PROJECTS\shit\smartbundle-repro> npm why @babel/core
@babel/core@7.26.0 optional
node_modules/@babel/core
  peer @babel/core@"^7.0.0" from @babel/helper-module-transforms@7.26.0
  node_modules/@babel/helper-module-transforms
    @babel/helper-module-transforms@"^7.26.0" from @babel/core@7.26.0
  optional @babel/core@"^7.26.0" from smartbundle@0.11.0
  node_modules/smartbundle
    smartbundle@"^0.11.0" from the root project

so he detects babel, which he downloaded himself

PS Z:\PROJECTS\shit\smartbundle-repro> npx smartbundle
Detecting modules
✅ typescript, version: 5.7.2
✅ babel, version: 7.26.0
❌ react
========================================
✅ Vite

@babel/core is peer dependency of https://npmjs.com/package/@babel/helper-module-transforms?activeTab=code

  "devDependencies": {
    "@babel/core": "^7.26.0"
  },
  "peerDependencies": {
    "@babel/core": "^7.0.0"
  },

When @babel/helper-module-transforms is dependency of @babel/core

Maybe it not smartbundle bug at all

XaveScor commented 3 days ago

https://github.com/blasdfaa/fastify-tma also affects this issue. Babel can be guilty of the long compilation time in the above lib. telegram-cloud-photo-size-2-5359754495896184154-y

XaveScor commented 3 days ago

related issue in pnpm: https://github.com/pnpm/pnpm/issues/5928