title: Import vue package in laravel
body: <p>What is the corect way to import vue packages in laravel 5.6? It comes with vue and bootstrap preinstall. I see they are all compile in app.js from public directory but I can figure out how to import <a href="https://github.com/moreta/vue-search-select" rel="nofollow noreferrer">https://github.com/moreta/vue-search-select</a> and use it. After I tried to import it on my own:</p>
  
  <p>Error:</p>
  
  <pre>ncaught TypeError: Vue.component is not a function</pre>
  
  <p>At line:</p>
  
  <pre><code>Vue.component('search-user', __webpack_require__(42));
  </code></pre>
  
  <p>Until now I tried this:</p>
  
  <p>assets/js/bootstrap.js:</p>
  
  <pre><code>import { BasicSelect } from 'vue-search-select';
  window.BasicSelect = BasicSelect;
  </code></pre>
  
  <p>assets/js/app.js:</p>
  
  <pre><code>require('./bootstrap');
  
  window.Vue = require('vue');
  window.Vue = require('vue-search-select');
  
  Vue.component('search-user', require('./components/SearchUser.vue'));
  
  var app = new Vue({
     el: '#app'
  })
  </code></pre>
  
  <p>components</p>
  
  <pre><code>&lt;template&gt;
      &lt;basic-select :options="options"
                    :selected-option="item"
                    placeholder="select item"
                    @select="onSelect"&gt;
      &lt;/basic-select&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  
      export default {
          data() {
              return {
                  keywords: null,
                  options: []
              };
          },
  
          watch: {
              keywords(after, before) {
                  if (this.keywords.length &gt; 0)
                      this.fetch();
              }
          },
  
          methods: {
              fetch() {
                  axios.get('/api/search', {params: {keywords: this.keywords}})
                      .then(response =&gt; this.options = response.data)
                      .catch(error =&gt; {
                      });
              },
              onSelect (item) {
                  this.item = item
              },
              reset () {
                  this.item = {}
              },
              selectOption () {
                  // select option from parent component
                  this.item = this.options[0]
              },
              components: {
                  BasicSelect
              }
          }
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I ran: npm install and npm run watch:</p>
  
  <pre><code>"devDependencies": {
          "ajv": "^6.0.0",
          "bootstrap": "^4.0.0",
          "cross-env": "^5.1",
          "laravel-mix": "^2.0",
          "lodash": "^4.17.4",
          "popper.js": "^1.12",
          "uikit": "^3.0.0-beta.35",
          "vue": "^2.5.7",
          "vue-search-select": "^2.5.0"
      },
      "dependencies": {
          "axios": "^0.17.1",
          "jquery": "^3.3.1"
      }
  </code></pre>