Git Product home page Git Product logo

Comments (3)

timocov avatar timocov commented on May 20, 2024 1

Good news: I found the reason of this bug - it is wrong detecting that some node is exported, if it is exported via export =.

Bad news: this bug can be fixed after (or together with) #17.

from dts-bundle-generator.

timocov avatar timocov commented on May 20, 2024

Hi,

The export = Cache is the only way I found that allows to use the library in the same way in both Typescript and Javascript

But why not export { Cache } from './lib/main'; (or even export * from './lib/main';) and then import { Cache } from 'mylib';?

But anyway, it seems that it is easy to reproduce, but I need some time to investigate this problem and figure out the solution.

from dts-bundle-generator.

endymion00 avatar endymion00 commented on May 20, 2024

@timocov export = Cache is the only way I found (after researching a lot) that allows to use the library in in the same way in Javascript and Typescript.
If I use export { Cache } from './lib/main' or export * from './lib/main' then in Typescript it works but when transpiled to Javascript I must make an instance in a different way:

const Cache = require('easy-cache').Cache;
const cache = new Cache();

or

const Cache = require('easy-cache');
const cache = new Cache.Cache();

By the way I just tested version 1.6.0 with same results.

from dts-bundle-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.