question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transpiling deps from node_modules

See original GitHub issue

Is it possible to transpile code from separate package as our dependency? That separate package contains untranspiled typescript code and it should go to the bundle along with our TS code.

P.S. "main" section from package.json of separate package points to .ts file.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ezolenkocommented, Nov 14, 2019

I’d add js files automatically if allowJs is set to true, but that brings build time from 6 seconds to 2 mins for me, so it’s an option one should turn on carefully 😃. See allowjs branch if you want to check it out.

1reaction
ezolenkocommented, Nov 14, 2019

Just looked at it again, and it seems all you need to do is allow plugin to touch js files: include: ["*.ts+(|x)", "**/*.ts+(|x)", "**/*.js"].

Currently only ts and tsx files are touched, even though you set allowJS: true in tsconfig and typescript would normally process js files in this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why and how to transpile dependencies of your JavaScript ...
Web developers use bundlers (Webpack or Rollup) that transpile their applications' code. We'll figure out how to transpile the dependencies ...
Read more >
Transpiling ESM files inside node_modules - Artem Sapegin
The idea is to use esbuild to compile ESM files to CommonJS directly inside the node_modules folder on npm install. Weʼll detect packages...
Read more >
How to transpile node_modules with babel and webpack in a ...
Using this modified version we are able to check if all our dependencies are transpiled or not, but it doesn't end there. There...
Read more >
Can I transpile TypeScript code of dependencies in ... - Reddit
I have Webpack and ts-loader set up. One of my dependencies (in node_modules/ ) publish typescript code (not .d.ts , just .ts )...
Read more >
Is it possible to transpile local modules from node_module?
I was wondering is it possible to transpile local modules from node_modules using webpack? Note: if I change the module type to "commonjs",...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found