-
-
Notifications
You must be signed in to change notification settings - Fork 433
Unable to compile const enum in .d.ts file. #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@zheeeng Couldn't you just |
|
@zheeeng Fair engouth. Does it work with plain |
I think you need to add a tripple-slash somewhere in your source like this: /// <reference path="./foo.d.ts" /> This is a way to tell the |
@KnisterPeter tsc works fine. I think it is something caused by webpack only consider files things are imported. Declaration files don't need to be imported. |
@zheeeng Please add a minimal repository to test this issue. It may help to understand it a bit more. |
Ok, I try build one. |
@KnisterPeter very sorry for my mistakes. I just then build a minimal project for test, if the declaration file is included by 'include' option |
Your welcome. I'm glad to help. |
Having this issue currently with the Vue CLI that uses webpack and ts-loader under the scenes. tried flipping transpileOnly on and off, and happymodepack on and off, no luck. |
Is there a way to generate a build error when we use enum instead of const enum in d.ts files? |
I'm using .d.ts to store some enum interfaces. But it seems that ts-loader doesn't include these .d.ts files in compiling.
A work situation:
output:
For reusing Direction as value and interface, I separated declaration and its applying. Unfortunately, the compiling failed.
output:
This way report
ReferenceError: Direction is not defined
in webpack compliing result.The text was updated successfully, but these errors were encountered: