craco icon indicating copy to clipboard operation
craco copied to clipboard

Adding uncompiled typescript library

Open stefansandulescu opened this issue 6 years ago • 3 comments

I have a "common library" written in Typescript and I want to use it in a couple more projects. I don't want to create a npm package from it, I just want to import it as "uncompiled package" but I'm having trouble setting this up. I tried adding ts-loader and excluding the module like this:

webpackConfig.module.rules.push({
  test: /\.tsx?$/,
  use: 'ts-loader',
  exclude: /node_modules\/((?!common-library).)*$/,
});

However, this results in Error: TypeScript emitted no output for /path/to/index,tsx. Can I please get some guidance on this? Thank you

stefansandulescu avatar Apr 30 '20 16:04 stefansandulescu

@stefansandulescu can you give more information if you fixed the issue?

ranisalt avatar Aug 08 '20 02:08 ranisalt

Hello, I haven't fixed this. I ended up compiling the library.

stefansandulescu avatar Aug 16 '20 09:08 stefansandulescu

Is there any way to do it without compiling the library?

richardaum avatar Sep 20 '20 22:09 richardaum