Closed whiskyjs closed 4 years ago
That is correct! Also there was a bug in the typeof
check. Thank you for your contribution!
@pawelgabryelewicz it looks like the 1.0.3 package in npm does not have this update, though the Github release Changelog says that it does. When I download and install the latest version (1.0.3), this patch is not included. In both index.js
and index.es.js
, it still shows:
if (typeof json.script !== "undefined" && typeof json.script["@_lang"] && json.script["@_lang"].toLowerCase() === "ts") {
I confirmed that the package.json
includes "version": "1.0.3",
.
Reproduction:
> npm pack babel-preset-typescript-vue@1.0.3
> tar -xvf babel-preset-typescript-vue-1.0.3.tgz
Then look at index.js
and see that this code has not been changed.
@pawelgabryelewicz it looks like someone else reported this issue a few months ago. Is there anything we can do to help get this new version launched? We're blocked from upgrading to babel just by this one line check!
Hi guys. First of all I am terribly sorry for no reply - I have changed my job and recently had no time for other activities. It seems that older build was published to npm with 1.0.3 (there is no npm prepare script so most likely I haven't built it before publishing...). It's a very side project (I am more into React these days) so it doesn't have proper attention and love.
Anyways I have just published version 1.0.4 that should contain an up-to-date build. This is a temporary solution, I guess vue will eventually support it properly. Thanks and again sorry.
Thank you for all of your work on this @pawelgabryelewicz. I know how these side projects can sometimes run away with our time. Best of luck in your new job!
First of all, thanks for the preset. Without it I'd probably stopped here and passed on making class-based components and Typescript work together.
It seems, however, it does not handle well cases when there are no attributes present on
script
tag in.vue
file, in whichfast-xml-parser
returns the inner text of the node as string instead of the object.On quick glance I haven't found the option to force it to always return object, so adding extra typechecks is probably the simplest way.