-
Notifications
You must be signed in to change notification settings - Fork 32
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
Cannot transpile typescript module as a dependency #13
Comments
if your project is in TS, you can import the "vue-composition-helpers" directly, or specific functions from "src" and not from "dist". (the "dist" folder is made for the non-ts users). in your
update use if it isn't working.. |
As far as I know I think there are still some significant differences between babel ts transpilation and ts-loader regarding decorators and type checking. The ability to emit declarations is another major difference but does not apply here since intermediate applications won't use vuex. |
Found the solution from @vue/cli-plugin-typescript:
The thought about this library is that we didn't want to transpile the code to a lower / uglier version of JS, and enforce our own transpilation of the code. |
@davidmeirlevy thanks for your solution! It was easy to apply to a raw webpack installation as well. To compile a ts module in a raw webpack installation:
The following points didn't apply to me, but someone may still find them helpful.
Example
|
Would you like to add this example and solutions to the README file for other developers to come? It will be very helpful! |
Sure! #15 |
Thanks! |
This module distributes typescript source files by default. This doesn't integrate well in a setup using webpack, babel and ts-loader, even if
allowTsInNodeModules
is enabled, vuex-composition-helpers is not excluded in webpack and tsconfig includes the path of this module. The compilation ends "successfully", but the code is not transpiled.In #3 there is a mention about importing
vuex-composition-helpers/dist
. Unfortunately, typings are missing.Discussion about packaging practices of typescript projects
The text was updated successfully, but these errors were encountered: