Making my Vue instance global when using Browserify so the developer tools are available Making my Vue instance global when using Browserify so the developer tools are available google-chrome google-chrome

Making my Vue instance global when using Browserify so the developer tools are available


If you assign the created vue instance to window object it should work:

var vm = new Vue({    el: '#app',    data:{        message: 'Worked!!!'    }});window.vue = vm

As for vue devtools I am not sure how they are activated for a particular vue instance, so far I've used them with vue router and they work out of the box.


Make sure to follow these notes from the documentation:

  1. vue-devtools only works with Vue.js 1.0.0+.

  2. For Vue version < 1.0.16, The devtool will only work with development (non-minified) versions of Vue, because the devtools hooks are stripped in production builds. This also includes builds produced by Webpack and Browserify in production mode. Vue >= 1.0.16 works with the devtools in all cases.

  3. To make it work for pages opened via file:// protocol, you need to check "Allow access to file URLs" for this extension in Chrome's extension management panel.