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

@swc/cli doesn't work under pnpm run script #9736

Open
andrejleitner opened this issue Nov 11, 2024 · 0 comments
Open

@swc/cli doesn't work under pnpm run script #9736

andrejleitner opened this issue Nov 11, 2024 · 0 comments
Labels

Comments

@andrejleitner
Copy link

Describe the bug

SWC transpiles sources to the output directory when running the local installation directly, but it doesn't do so when running via a pnpm script.

Input code

pnpm build

> @my-project/playground@1.0.0 build /path/to/my-project/
> swc **/**.ts -d dist

Config

{
  "$schema": "https://swc.rs/schema.json",
  "exclude": ["test/**/*"],
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "decorators": true,
      "dynamicImport": true
    },
    "transform": {
      "legacyDecorator": true,
      "decoratorMetadata": true
    },
    "paths": {
      "@my-project/app/*": ["apps/app/src/*"],
      "@my-project/lib/*": ["libs/lib/src/*"]
    },
    "baseUrl": ".",
    "target": "es2022"
  },
  "module": {
    "type": "commonjs",
    "strictMode": true
  },
  "sourceMaps": "inline"
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs

SWC Info output

Operating System:
Platform: darwin
Arch: arm64
Machine Type: arm64
Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
CPU: (8 cores)
Models: Apple M1 Pro

Binaries:
    Node: 20.11.0
    npm: 10.2.4
    Yarn: 1.22.22
    pnpm: 9.12.3

Relevant Packages:
    @swc/core: 1.7.40
    @swc/helpers: N/A
    @swc/types: N/A
    typescript: 5.6.3

SWC Config:
    output: N/A
    .swcrc path: N/A

Next.js info:
    output: N/A

Expected behavior

It works.

Actual behavior

No errors, no output.

Version

@swc/cli: 0.5.0

Additional context

Direct call to local CLI installation works fine:

pnpm swc **/**.ts -d dist
Successfully compiled: 1237 files with swc (958.71ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant