Skip to content
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

is babel dependency required? #29

Open
fei4xu opened this issue Sep 3, 2019 · 3 comments
Open

is babel dependency required? #29

fei4xu opened this issue Sep 3, 2019 · 3 comments

Comments

@fei4xu
Copy link

fei4xu commented Sep 3, 2019

Hi,

I was trying to create a vue+typescript+nativescript web+native project combo.

I run vue create dao-ts first, uncheck babel/linter, check typescript, kept all following default settings. So this is a purely typescript vue project with dependencies below:

  "dependencies": {
    "vue": "^2.6.10",
    "vue-class-component": "^7.0.2",
    "vue-property-decorator": "^8.1.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-typescript": "^3.11.0",
    "@vue/cli-service": "^3.11.0",
    "typescript": "^3.4.3",
    "vue-template-compiler": "^2.6.10"
  }

Then I run vue add vue-cli-plugin-nativescript-vue with all default settings, then run tns migrate, then I run 'npm run serve:android' but got this error:

ERROR in ./components/HelloWorld.vue?vue&type=script&lang=ts& (../node_modules/ts-loader??ref--10-0!../node_modules/vue-loader/lib??vue-loader-options!../node_modules/string-replace-loader??ref--13-1!./components/HelloWorld.vue?vue&type=script&lang=ts&)
Module not found: Error: Can't resolve 'babel-loader' in 'D:\Projects\dao-ts\src'
 @ ./components/HelloWorld.vue?vue&type=script&lang=ts& (../node_modules/ts-loader??ref--10-0!../node_modules/vue-loader/lib??vue-loader-options!../node_modules/string-replace-loader??ref--13-1!./components/HelloWorld.vue?vue&type=script&lang=ts&) 2:0-62 9:8-12 12:8-17 17:2-5
 @ ./components/HelloWorld.vue?vue&type=script&lang=ts&
 @ ./components/HelloWorld.vue
 @ ../node_modules/ts-loader??ref--10-0!../node_modules/vue-loader/lib??vue-loader-options!../node_modules/string-replace-loader??ref--13-1!./App.vue?vue&type=script&lang=ts&
 @ ./App.vue?vue&type=script&lang=ts&
 @ ./App.vue
 @ ./main.native.ts
 @ multi ./main.native

it seems that babel-loader is required, but I guess when I created the vue web project, it's sure to be able to run without babel.

@fei4xu
Copy link
Author

fei4xu commented Sep 3, 2019

I'm sure I can create a nativescript + typescript (without babel) project too, so:

nativescript + typescript (without babel), ok
vue + typescript (without babel), ok

then

nativescript + vue + typescript (without babel), ??

@jawa-the-hutt
Copy link
Collaborator

I've just released 0.2.0 of the plugin to npm. This includes NS 6.1.0 and NS-Vue 2.4.0. Try it again and let me know if this addresses things.

The vue cli generator is set to only install babel-loader if it detects Babel as part of the original Vue project. I'm wondering if the tns migrate caused an issue? Not sure. Try 0.2.0 of this plugin and see if this fixes the overall issue you had with getting a project up and going.

@fei4xu
Copy link
Author

fei4xu commented Sep 10, 2019

I'm sorry but I have the same error:

ERROR in ./components/HelloWorld.vue?vue&type=script&lang=ts& (../node_modules/ts-loader??ref--10-0!../node_modules/vue-loader/lib??vue-loader-options!../node_modules/string-replace-loader??ref--13-1!./components/HelloWorld.vue?vue&type=script&lang=ts&)
Module not found: Error: Can't resolve 'babel-loader' in 'D:\Projects\dao-ts\src'
 @ ./components/HelloWorld.vue?vue&type=script&lang=ts& (../node_modules/ts-loader??ref--10-0!../node_modules/vue-loader/lib??vue-loader-options!../node_modules/string-replace-loader??ref--13-1!./components/HelloWorld.vue?vue&type=script&lang=ts&) 2:0-62 9:8-12 12:8-17 17:2-5
 @ ./components/HelloWorld.vue?vue&type=script&lang=ts&
 @ ./components/HelloWorld.vue
 @ ../node_modules/ts-loader??ref--10-0!../node_modules/vue-loader/lib??vue-loader-options!../node_modules/string-replace-loader??ref--13-1!./App.vue?vue&type=script&lang=ts&
 @ ./App.vue?vue&type=script&lang=ts&
 @ ./App.vue
 @ ./main.native.ts
 @ multi ./main.native

it seems that ts-loader uses vue-loader then uses babel-loader, I will confirm in a nativescript only android app whether babel-loader is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants