Generate library with .ts and .js together
See original GitHub issueHi,
I am not totally sure if this bug is from this plugin.
What happens and why it is wrong
I am trying to package a library using .ts and .js files at same time, the entry file is a .ts file and this file make a require to a .js file (It is because this files are generated because the base project is made with reasonML and i want to generate the library for multiple languages). The problem is that the output is not valid to consume, this output has require to files that don’t exist in this directory. I don`t know if it is possible to bundle .js and .ts together with this plugin.
I have created a repository with the example i am talking about
What an i doing wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to combine TypeScript code and JS libraries into one file ...
I am a TypeScript newb and I can't imagine I'm the first one to want to combine TS output with random JS libraries...
Read more >Tutorial for Writing a TypeScript Library - tsmean
How to Write a TypeScript Library ; Step 1: Setup tsconfig.json ; Step 2: Implement your library ; Step 3: Create an index.ts...
Read more >Documentation - Creating .d.ts Files from .js files - TypeScript
Run the TypeScript compiler to generate the corresponding d.ts files for JS files; (optional) Edit your package.json to reference the types. Adding TypeScript....
Read more >Chapter 7. Using TypeScript and JavaScript in the same project
Enjoying TypeScript's benefits when working with a JavaScript library; The role of type definition files; Upgrading an existing JavaScript app to TypeScript ...
Read more >Using Rollup to package a library for TypeScript and JavaScript
The first file is the d.ts declaration file that describes the shape of an existing JavaScript codebase for TypeScript. The second file, bundle....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try setting
allowJs
intsconfig.json
. Also can you change requires to imports?@n2k3s2it check if anything from those js files is actually used, rollup will treeshake imports that are not needed.