title: installing JS packages using npm and compiling with webpack laravel mix
body: <p>I am new to Laravel and following Laracast tutorials for Laravel 5.4<br>
  I read about Laravel mix and how we can compile our assets using Webpack Laravel Mix tool. So I tried adding a JavaScript Package<br>
  <br>
  1- Installed <strong>AlertifyJS</strong> using <strong>npm</strong>.<br>
  2- Added <code>require('alertifyjs')</code> in <code>resources\assets\js\bootstrap.js</code><br>
  3- Executed <code>npm run dev</code>. Assets were compiled to <code>public\js\app.js</code> , where I can see <strong>alertifyjs</strong> code by finding <strong>alertify</strong> keyword.<br>
  <br>
  I used <strong>alertify</strong> code like below in <strong>resources\assets\js\app.js</strong>:<br></p>
  
  <pre><code>`$(document).ready(function(){
      $('.run').on('click' , function(event){
          alertify.alert("This is an alert dialog.", function(){
          alertify.message('OK');
      });
    });
  });`
  </code></pre>
  
  <p><br>
  View File:<br></p>
  
  <pre><code>@extends('layouts.app')
  @section('content')
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-8 col-md-offset-2"&gt;
              &lt;div class="panel panel-default"&gt;
                  &lt;div class="panel-heading text-center"&gt;&lt;h2&gt;THIS WILL BE THE HOME PAGE&lt;h2&gt;&lt;/div&gt;
                  &lt;div class="panel-body text-center"&gt;
                      Home Page Content Goes Here!
                  &lt;/div&gt;
                              &lt;button class="run"&gt;Show Alert&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  </code></pre>
  
  <p><br><strong>Problem:</strong> When I click on button <strong>Show Alert</strong> , <br>
  <strong>alertify is not defined</strong> errors is logged to console. Am I missing something while compiling assets?</p>