Autocomplete in vscode while using vue cdn - vue.js

I'm building a project where some parts of the webpage are Vue components. And offcourse I'm using Vscode to develop it. Since this is not a complete Vue app I'm not able to use extensions like vetur to autocomplete. I was wondering if there was a way to tell Vscode that <script> includes "Vue" code or is there an extension to do so?

I don't think there is.
Just try working with it that way.
Or better still, work with the .vue files in a separate folder and move them to your current working directory when you're done.
Not efficient, but it's the best solution I can think of.

Related

Testing common code in multiple files in Vue with Jest

We have a website using Vue 2.0 and Jest as testing environment. In most vue components we have the same type of watchers which means we just have to copy the same code between all of them to make sure the code is covered.
Is there a way to run this for all files automatically?
Haven't been able to find a valid solution to this.

Title cannot contain "Automatic import from npm to vue app"

npm is great to download some js libraries, but including the into a vue app is really hard. i have no idea if there is an "official" way, but searching online i see so many different approaches.
sometimes it is imported in the app.js file, sometimes in the .vue files inside the tags. i have also seen that there are vue plugins that handle differently. how should i know if i have a vue plugin or not? i don't even know what the other option would be. like a vue module instead of a vue plugin?
is there a way that the vue app just includes/imports the stuff from node_modules so i can use it? so that after doing some npm install it is all available?
Npm just downloads the library into the node_modules folder and let's you access it where you need it.
If it's a vue component you need to import it in a vue file, because that's where you need it.
If it's a vue plugin you have to import it in the main js file because that's where it gets initalized in the whole app.
Looks like you are new to vue, I suggest you to take a look at this simple guide where you can learn some basic stuff.

How do I build a Vue app to use it in another app?

I'm pretty new to Vue and to dev in general. I was asked to dev an app in Vue.
So I did it, with multiple components, to make the code as maintainable as possible. I also installed dependencies
But now, this app must be usable in another Vue app... And I can't find how to build it so I can import it in another app. I would really appreciate some help. Thank you.
You can use build targets like library or web-component for this.
https://cli.vuejs.org/guide/build-targets.html#app

What is the difference between importing Vue.js library and installing it via Vue-CLI?

Could you please explain what is the main difference between different Vue installation methods for building a one-page website (page routing) with Vue and an Electron app using Vue:
importing Vue.js library via <script>
installing it via Vue-CLI
This installation guide doesn't really help understand the difference.
Is my site / app going to work slower if I just import Vue via <script>?
The <script> include is for including the Vue library in your webpage just like you would any other JavaScript library. Vue will be available on the window object for you to access globally. All external JavaScript must be included like this one way or another, even if you use vue-cli.
vue-cli is just a tool which generates Vue projects from templates. The setup really depends on the template that you use; I imagine most people would probably use the webpack template for medium to large sized Vue projects. This will initialize a node project directory containing all files necessary to develop, debug, test and build a Vue project. Webpack takes care of bundling all modules into a single JavaScript bundle which is included into the webpage via <script>. You can also benefit from vue-loader which allows you to write Vue components in *.vue files.
Is my site / app going to work slower if I just import Vue via <script>?
I mean, not really, no (your development speed might be hindered though since you won't benefit from all the bells and whistles that vue-cli sets you up with). Your question applies more to the development approach that you will follow for developing a Vue web application.

Aurelia bundling and exporting not works properly

It is maybe a trivial question but I am quite lost in topic I don't know.
I am writing my first app n Aurelia using ES2016. I wanted to export my app to server for some testing.
As I learn in Plularsight course https://app.pluralsight.com/library/courses/aurelia-fundamentals/ that the easiest way to bundle and export is to use Aurelia Skeleton Navigation - by changing all theirs src files to ours and adding all the missing dependencies in package.json, and also adding them to bundle.js and export.js.
When I use
git bundle
git serve
Bundling works fine, and app is running fine.
But when i run
gulp export
The files in export dir not working properly. I have an "Uncaught SyntaxError: Unexpected token <" error in almost js file I wrote or added to my App (not in aurelia files :/ I deployed it temporally here so you can check https://amazingcms-0-3.firebaseapp.com/drag/posts
It looks like I messed it up at all :/ I don't know what files I should show you to help, so please tell me, or give mi a good source where I can learn how to export my app. It is possible to do it without the Aurelia Skeleton Navigation? I think I even don't necessarily need bundling only transpiling (I'm using Babel runtime). I want to check if my app works on server it can work slow at this step.