Comments (5)
Hi @Scorpio1337,
actually this is second known limitation (see https://github.com/timocov/dts-bundle-generator/blob/master/README.md#known-limitations). I believe this issue can be solved along with other issues marked with https://github.com/timocov/dts-bundle-generator/issues?q=is%3Aissue+is%3Aopen+label%3Adetect-import-path-problem label.
As workaround you can try to import without renaming, e.g. import { Stats } from 'fs'
, but it can doesn't work in some cases.
from dts-bundle-generator.
I have a similar issue.
For example, there are some helper functions in a.ts
, I hope to export a
as a property from b
.
but dts-bundle-generator
can't do that.
a.ts
export function doSomething1() {
}
export function doSomething2() {
}
b.ts
import * as a from './a'
export default {
a: a
}
from dts-bundle-generator.
@musicode what error you get? It looks your issue is about 2nd known limitation (see https://github.com/timocov/dts-bundle-generator#known-limitations).
from dts-bundle-generator.
yes, It's 2nd known limitation, but I think it's maybe useful.
for my scenario, I have a module a
that define some helper functions.
then I want to export a
from entry point.
b.ts
import * as a from './a'
export default {
a: a
}
then I can use it like below:
import b from 'b'
b.a.doSomething1()
It's a common case, I need type suggestion in my vscode.but dts-bundle-generator
will report a is not define
.
so i have to write a declaration file manually, and set the type for a
.
import * as a from './a'
import aType from './aType'
export default {
a: aType: a
}
It's ok, but it's so trouble and hard to maintenance.
from dts-bundle-generator.
Thank you guys ... As I sad, I use right now "hack" with require.
It is not good because I must use is really often. :D
from dts-bundle-generator.
Related Issues (20)
- Issue setting both `excludeInternal` and `placeInternalsInOwningModule` HOT 2
- jsdoc comments aren't renamed alogn with their nodes HOT 9
- Do not compile bundled output together as they might have incompatible global declarations
- Do not rename a node if known global name refers to this a symbol of that node
- jsdoc comments are stripped for nodes that were renamed because of the name collision
- Namespaced imports/exports don't generate a namespace if they are exported via name
- TS2307: Cannot find module *.module.css HOT 1
- Not all symbols in a declaration merging are exported
- Investigation: Use of `Context.Tag` from `effect` causes 4x slowdown HOT 13
- Star-imports don't get included in the bundle HOT 4
- Generics extended with declare module statement aren't included HOT 2
- Option to disable tree-shaking HOT 12
- Improve validation time performance by re-using caching compiler host from previous steps
- The exportElementSymbol occasionally returns undefined, resulting in an error in const namespaceImportForElement = getDeclarationsForSymbol(exportElementSymbol).find(ts.isNamespaceImport);. HOT 4
- Declarations of "unknown" modules aren't included despite enabled `inlineDeclareExternals` flag
- Maximum call stack size exceeded (Infinite Loop) at `computeUsagesRecursively` HOT 5
- Constants declared by using object/array binding pattern syntax fail the build HOT 9
- [9.4.0] A definition being referenced is lacking HOT 6
- Namespace import disappeared in output HOT 3
- Output strips `type` keyword from type import HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dts-bundle-generator.