Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
use browserify-shim to load some deps from CDNs
Browse files Browse the repository at this point in the history
allows us to load some client-side code in parallel from CloudFlare.

so far only done `angular`, `angular-material`, `angular-material-icons`, and `jquery`. this shows how we could do more as we wish.
  • Loading branch information
ahdinosaur committed Aug 14, 2016
1 parent f78703b commit 5db502e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 4 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> -->

<link rel="stylesheet" type="text/css" href="styles/angular-material.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/0.10.0/angular-material.min.css">
<link rel="stylesheet" type="text/css" href="styles/index.css">

<!-- favicon stuff lol -->
Expand Down Expand Up @@ -51,6 +51,9 @@
<div ui-view class="cobudget-app">
</div>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/0.10.0/angular-material.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material-icons/0.6.0/angular-material-icons.min.js"></script>
<script src="scripts/index.js"></script>
</body>
</html>
4 changes: 0 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
global.jQuery = require('jquery')
global._ = require('lodash')
global.moment = require('moment')
global.camelize = require('camelize')
Expand All @@ -7,18 +6,15 @@ global.listify = require('listify')
global.isEmptyObject = require('is-empty-object')
global.browser = require('bowser')

require('angular')
require('angular-ui-router')
require('angular-sanitize/angular-sanitize')
require('angular-cookie')
require('ng-token-auth')
require('angular-aria')
require('angular-animate')
require('angular-material')
require('angular-messages')
require('ng-focus-if')
require('angular-upload')
require('angular-material-icons')
require('ng-sanitize')
require('angular-truncate-2')
require('angular-marked')
Expand Down
7 changes: 7 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
"transform": [
["coffeeify", { "extension": ".coffee" } ],
["browserify-ngannotate", { "ext": [ ".js", ".coffee" ] } ],
"browserify-shim",
"babelify",
"envify",
["evalify", { "files": ["app/configs/app.js", "node_modules/app/configs/app.js"] } ],
["txtify2", { "extensions": [ "html" ] } ],
"concatenify"
]
},
"browserify-shim": {
"jquery": "global:jQuery",
"angular": "global:angular",
"angular-material": "global:angular",
"angular-material-icons": "global:angular"
}
}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,13 @@
"napa": {},
"dependencies": {
"ampersand-state": "^4.5.6",
"angular": "^1.3.2",
"angular-animate": "^1.4.3",
"angular-aria": "^1.4.3",
"angular-autodisable": "^0.2.2",
"angular-autoselect": "^0.3.2",
"angular-chart.js": "^1.0.0-alpha3",
"angular-cookie": "ivpusic/angular-cookie#v4.0.9",
"angular-marked": "[email protected]:Hypercubed/angular-marked.git",
"angular-material": "^0.10.0",
"angular-material-icons": "^0.6.0",
"angular-messages": "^1.4.3",
"angular-sanitize": "^1.3.8",
"angular-truncate-2": "^0.1.2",
Expand Down Expand Up @@ -91,6 +88,7 @@
"brfs": "^1.2.0",
"browserify": "^10.2.4",
"browserify-ngannotate": "^0.7.1",
"browserify-shim": "^3.8.12",
"chai": "^1.10.0",
"chai-as-promised": "^4.1.1",
"coffee-script": "^1.8.0",
Expand Down

0 comments on commit 5db502e

Please sign in to comment.