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
Wrong generated JS code by TypeScript and AMD ( + UMD) #7374
Comments
Same problem here, i'm trying to fix it for: ...but, as I can see, there is no default export in vue(.min).js. import { Vue } from "vue-property-decorators"; ...this is the only way I can get it working for now, keep in mind that this is not the real solution. |
@Micene09 Thanks! |
There seems to be nothing in your config that points the |
Thanks! |
Version
2.5.2
Reproduction link
https://github.com/80LevelElf/VueProblemApp
Steps to reproduce
Just run the app by opening the
/VueProblemApp/VueProblemApp/index.html file and you will see the error in the Console.
What is expected?
The Typescript compiler should take Vue typings and produce the right code.
What is actually happening?
The resulted JS code is not right (see comments for detail explonation).
I want to use Vue.js in my Typescript application. I try to add it via NPM.
Package.json:
tsconfig.json:
Then I try to use it:
As you can see in my tsconfig file I use the AMD module system. That means that each
import x
should produce some information in the define function in the result JS file. And it is:But the problem is on some step something goes wrong and I get the wrong generated code.
vue_1 in the JS code above is a Vue constructor (and it is right). And I should get this:
Instead of this:
Of course, vue_1.default is undefined and it gives me an error.
Note: I use this vue.js file version - the right one for AMD and UMD module system. And I have the same problem when I try to use UMD module system vie tsconfig.
Used Typescript version is 2.6.2.
The text was updated successfully, but these errors were encountered: