title: Browserify-shim Load first
body: <p>I have problem with browserify-shim and bootstrap-datetimepicker. Bootstrap-datetimepicker need moment.js but this plugin must loaded first then datetimepicker.
  My code: </p>
  
  <pre><code>"browser": {
              "moment": "./moment.js",
              "datetimepicker": "./eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"
          }, 
  "browserify-shim": {
          "jquery": {
              "exports": "jQuery"
          },
          "moment": "global:moment",
          "datetimepicker": {
              "depends": [
                  "jquery",
                  "moment"
              ]
          }
  }
  </code></pre>
  
  <p>Then i only require it.</p>
  
  <pre><code>require('jquery');
  require('moment');
  require('bootstrap-datepicker');
  </code></pre>
  
  <p>But when i use it console throw error. <strong>Uncaught Error: bootstrap-datetimepicker requires Moment.js to be loaded first</strong></p>
  
  <p>How can i load Moment.js first?</p>
  
  <p>Thank you! :)</p>
  
  <hr>
  
  <pre><code>package.json
  
  {
    "name": "Mikos",
    "version": "1.0.0",
    "description": "Mikos front-end",
    "main": "index.js",
    "dependencies": {
      "bootstrap": "^3.3.6",
      "bootstrap-datepicker": "^1.6.0",
      "browserify": "^13.0.0",
      "eonasdan-bootstrap-datetimepicker": "^4.15.35",
      "fs": "0.0.2",
      "gulp": "^3.9.0",
      "gulp-concat": "^2.6.0",
      "gulp-if": "^2.0.0",
      "gulp-imagemin": "^2.4.0",
      "gulp-less": "^3.0.5",
      "gulp-minify": "0.0.5",
      "gulp-minify-css": "^1.2.3",
      "gulp-rev-all": "^0.8.22",
      "gulp-uglify": "^1.5.1",
      "i18n": "^0.8.1",
      "jquery": "^2.2.1",
      "jquery-autosize": "^1.18.18",
      "jquery-slimscroll": "^1.3.6",
      "jquery-ui": "^1.10.5",
      "mkdirp": "^0.5.1",
      "moment": "^2.12.0",
      "select2": "^4.0.2",
      "slick-carousel": "^1.5.9",
      "vinyl-buffer": "^1.0.0",
      "vinyl-source-stream": "^1.1.0"
    },
    "devDependencies": {
      "browserify-shim": "^3.8.12",
      "del": "^2.2.0",
      "i": "^0.3.4",
      "imagemin-pngquant": "^4.2.0"
    },
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "Mikos",
    "license": "ISC",
    "browserify": {
      "transform": [
        "browserify-shim"
      ]
    },
    "browser": {
      "slick": "slick-carousel",
      "nette-ajax": "./js_modules/nette-ajax/nette.ajax.js",
      "nette-ajax-history": "./js_modules/nette-ajax-history/client-side/history.ajax.js",
      "image": "./js_modules/image-qest/image.js",
      "datetimepicker": "eonasdan-bootstrap-datetimepicker"
    },
    "browserify-shim": {
      "datetimepicker": {
        "depends": [
          "jquery: jQuery",
          "moment: moment",
          "bootstrap: bootstrap"
        ]
      },
      "nette-ajax-history": {
        "depends": [
          "jquery"
        ]
      },
      "nette-ajax": {
        "depends": [
          "jquery:jQuery"
        ]
      },
      "bootstrap": {
        "depends": [
          "jquery"
        ]
      },
      "slick": {
        "depends": [
          "jquery"
        ]
      }
    }
  }
  </code></pre>
  
  <p>And here how i call it:</p>
  
  <pre><code>app.main.js
  
  $ = jQuery = require('jquery');
  require('bootstrap');
  
  require('nette-ajax');
  require('nette-ajax-history');
  
  require('moment');
  //require('bootstrap-datepicker');
  require('datetimepicker');
  
  require('jquery-ui');
  require('slick');
  require('select2');
  
  require('./init.js');
  require('./menu.js');
  
  
  /*$(".datepicker").datepicker({
      language: 'cs'
  });*/
  
  $('.datetimepicker').datetimepicker();
  </code></pre>