I am facing an issue with a javascript file called scripts.js containing vue js code:
var app2 = new Vue({
el: '#app-2',
data:{
message: 'Some msg'
}
})
After building the js file using gulp elixir webpack, I include public/js/app.js in my html and everything works perfectly fine. However, when I try to log the variable, it returns as undefined.
console.log(app2); //undefined
If I include scripts.js directly in the html without webpack, it works as expected. So, how can I successfully log this variable after webpack build? Any suggestions would be appreciated. Thank you!