ncc icon indicating copy to clipboard operation
ncc copied to clipboard

Add support for jsconfig.json

Open rokinsky opened this issue 5 years ago • 4 comments

It would be great if ncc supports jsconfig.json out of the box.

jsconfig.json is a descendant of tsconfig.json, which is a configuration file for TypeScript. jsconfig.json is tsconfig.json with "allowJs" attribute set to true.

rokinsky avatar Sep 10 '20 14:09 rokinsky

Does vercel allow jsconfig.json when building? I have a compilerOptions in my project and that's the only thing preventing me from migrating to vercel.

matepaiva avatar Jan 06 '21 19:01 matepaiva

I tested it and it worked like a charm, at least with my use-case. :)

matepaiva avatar Jan 07 '21 00:01 matepaiva

Anything up with this issue? I have a NextJS project and I need to be able to manually run a couple of scripts, but I need to use the app codebase (service functions) for them. I'm using jsconfig.json with multiple paths aliases and the NextJS app runs fine. However, when importing an alias, ncc throws the following:

Error: Cannot find module '@utils/storage'

jsconfig.json is in the same folder (project root) as the script I'm trying to run. It just seems that ncc doesn't see jsconfig.json.

Here's my jsconfig.json:

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "@utils/*": ["utils/*"],
            "@utils": ["utils/index"],
        }
    }
}

neeppy avatar Jan 11 '22 19:01 neeppy

I am also facing the same issue, in SignInForm.jsx I imported import signIn from '@myFirebase/auth/SignIn'; and it seems vercel doesn't understand custom paths

./app/sign-in/SignInForm.jsx
--
14:12:28.702 | Module not found: Can't resolve '@myFirebase/auth/SignIn

This is my jsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@myFirebase/*": ["components/firebase/*"],
      "@components/*": ["components/*"],
      "@styles/*": ["styles/*"]
    }
  }
}

goheesheng avatar Jun 13 '23 06:06 goheesheng