1👍
✅
This is how usually use it from node_module
import Vue from 'vue'; // this will check inside node_modules for the file and include
1👍
Instead of loading the files through a script tag, use require()
in your javascript. For example:
const express = require("express");
const vue = require("vue");
This will work on both the client and on the server.
1👍
Why not use a CDN?
This way, the browser will not have to download the Vue file from your server if it has already been cached. Also, you may be able to use the vue.min.js file which will load even faster than the normal Vue dist file…
For example, here is a script from cdnjs.com you could try:
<script
src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.min.js"
integrity="sha256-ngFW3UnAN0Tnm76mDuu7uUtYEcG3G5H1+zioJw3t+68="
crossorigin="anonymous"></script>
Try replacing your script tag with this.
Source:stackexchange.com