My goal is to integrate a Vue.js application into an existing webpage using script tags. Upon running `npm run build` in my Vue application, I end up with 7 compiled files:
- app.js
- app.js.map
- manifest.js
- manifest.js.map
- vendor.js
- vendor.js.map
- app.css
Initially, I attempted to load the three main js files (manifest, vendor, and app - excluding the map files) as sources within script tags on a separate webpage in hopes of having the Vue application display on that page.
(Although not currently concerned about it, the css file would also be loaded onto the page.)
However, even after inserting the js files as sources in script tags, the Vue application does not appear to be 'executed' and there are no DOM elements present on the page from the Vue application.
In addition to loading the three main js files, I've also included the vue.js (development version) js file via a script tag on the page.
While I am not well-versed in web-pack, it seems like there may be a step required to prompt webpack to execute the Vue application on this separate webpage, considering webpack is used for local execution of the Vue application.
I'm uncertain if what I am attempting is feasible and have been unable to locate any resources illustrating how to achieve this integration.
If possible, please share any relevant guidance or information regarding whether this method is correct for running a Vue application within a third-party webpage.
EDIT
Here is the JavaScript code utilized to insert the script tags with the src of the files:
var head = document.getElementsByTagName('head')[0];
var js = document.createElement("script");
js.src = "/js/app.js";
head.appendChild(js);
The above code snippet is repeated for each of the files (app, manifest, and vendor). This is the extent of my implementation, where the script tags exist on the page with the corresponding sources. In Chrome debugger's sources tab, all three js files are seen being appropriately loaded.