Skip to content

Commit

Permalink
fix(generators): add omitted new files
Browse files Browse the repository at this point in the history
  • Loading branch information
cueedee committed Oct 10, 2017
1 parent 021334d commit 552cf8d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions generators/app/templates/vendor/jquery-for-cdns-shim.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
###*
# @author David Bouman
# @module App
###

'use strict'


###*
# This shim exist solely for the purpose of exposing the bundled `jquery` on the global scope as `jQuery`.
#
# This way, any CDN loaded code that expect it there, will be able to find it.
#
# The shim has no code of itself and exports nothing; The file simply provides the handle needed to get
# [`browserify-shim`](https://github.com/thlorenz/browserify-shim#readme) to do its magic.
#
# Please have a look at the `package.json`. In it, you'll find these bits:
#
# ```json
# "browser": {
# ...
# "jquery-expose": "./vendor/jquery-expose.coffee"
# ...
# },
# ```
#
# ```json
# "browserify-shim": {
# ...
# "jquery-expose": {
# "depends": [ "jquery:jQuery" ]
# }
# ...
# },
# ```
#
# This tells [`browserify-shim`](https://github.com/thlorenz/browserify-shim#b-config-inside-packagejson-with-aliases), that this file expects to find the
# `jquery` package as `jQuery` on the global scope, and so, any externally loaded framework code will be able to find it there too.
#
# (It also tells [`browserify`](https://github.com/substack/browserify-handbook#browser-field) where it can find this file whenever a
# `require('jquery-expose')` happens.)
#
# <h5>Why not just `window.jQuery = require( 'jquery' )`?</h5>
#
# That would work for sure; but by doing it through `browserify-shim` you have one consistent, centralized way of expressing these kind of dependencies.
#
# @class JQueryForCDNs
# @static
###

0 comments on commit 552cf8d

Please sign in to comment.