Skip to content
Discussion options

You must be logged in to vote

I can reproduce this class of Debug Failure with the combination of tsconfig: false, outDir, and the TypeScript plugin's output-file lookup. Loading the actual tsconfig is worth trying before changing the JSON data:

const plugins = [
  json(),
  typescript({
    tsconfig: './tsconfig.json',
    // Let plugin-json handle JSON modules; this filter is for code files.
    include: ['./src/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}'],
    exclude: tsconfig.exclude,
  }),
  resolve({ preferBuiltins: true }),
  commonjs(),
];

Keep resolveJsonModule: true in the actual tsconfig so TypeScript can type-check JSON imports. You do not need to copy compilerOptions into the plugin if the file already contain…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dimaslanjaka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants