Permalink
Browse files

Replace jQuery with lodash

Renamed all paths from 'components' to 'bower_components'
  • Loading branch information...
1 parent 21b8204 commit 152e689b0e95bbaf6aefe4866c1458bb58e5f57d @aleksandara committed Oct 26, 2013
View
@@ -1,2 +1,4 @@
node_modules/
temp/
+
+.idea
View
@@ -19,4 +19,4 @@
"trailing": true,
"smarttabs": true,
"white": true
-}
+}
View
@@ -35,7 +35,7 @@ AppGenerator.prototype.askFor = function askFor() {
'\n ´ ' + chalk.red('` |') + '° ' + chalk.red('´ Y') + ' `\n';
console.log(welcome);
- console.log('This comes with requirejs, jquery, and grunt all ready to go');
+ console.log('This comes with requirejs, lodash, and grunt all ready to go');
if (this.options.promptDefaults) {
this.appname = this.options.promptDefaults.appname;
@@ -21,7 +21,7 @@ module.exports = function(grunt) {
stripBanners: true
},
dist: {
- src: ['components/requirejs/require.js', '<%%= concat.dist.dest %>'],
+ src: ['bower_components/requirejs/require.js', '<%%= concat.dist.dest %>'],
dest: 'dist/require.js'
},
},
@@ -95,7 +95,7 @@ module.exports = function(grunt) {
return [
// rewrite requirejs to the compiled version
function(req, res, next) {
- if (req.url === '/components/requirejs/require.js') {
+ if (req.url === '/bower_components/requirejs/require.js') {
req.url = '/dist/require.min.js';
}
next();
View
@@ -17,7 +17,7 @@ Note: If you don't have `npm` installed, make sure you have
The above steps will download all the required software to
build and run this app, such as [grunt](http://gruntjs.com),
-[requirejs](http://requirejs.org), and [jquery](http://jquery.com).
+[requirejs](http://requirejs.org), and [lodash](https://github.com/lodash/lodash).
## Running the server
@@ -63,6 +63,6 @@ the only pieces required to run the application in its built
state is running `grunt`.
If you're using a webserver like apache or nginx, you'll want
-to create a redirect from `/components/requirejs/require.js` to
+to create a redirect from `/bower_components/requirejs/require.js` to
`/dist/require.js`. (*Note: this is exactly what `grunt
preview-live` does*)
@@ -2,7 +2,7 @@
"name": "<%= _.slugify(appname) %>",
"dependencies": {
"requirejs": "~2.1.5",
- "jquery": ">= 1.8.0",
+ "lodash": ">= 2.2.1",
"qunit": "~1.11.0"
}
}
@@ -1,17 +1,12 @@
require.config({
// make components more sensible
- // expose jquery
+ // expose lodash
paths: {
- "components": "../components",
- "jquery": "../components/jquery/jquery"
+ "components": "../bower_components",
+ "lodash": "../bower_components/lodash/dist/lodash"
}
});
if (!window.requireTestMode) {
require(['main'], function(){ });
-}
-
-
-
-
-
+}
@@ -1,6 +1,6 @@
-// to depend on a bower installed component:
-// define(['component/componentName/file'])
+define(["lodash"], function(_) {
+ var info = document.createElement("span");
+ info.textContent = 'lodash ' + _.VERSION + ' loaded!';
-define(["jquery"], function($) {
- $('body').append('jQuery ' + $.fn.jquery + ' loaded!');
+ document.body.appendChild(info);
});
View
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title><%= appdescription %></title>
- <script data-main="app/config" src="components/requirejs/require.js"></script>
+ <script data-main="app/config" src="bower_components/requirejs/require.js"></script>
</head>
<body>
<h1><%= appname %> running!</h1>
@@ -12,7 +12,7 @@
"eqnull": true,
"browser": true,
"predef": [
- "jQuery",
+ "_",
"QUnit",
"require",
"define",
@@ -33,9 +33,9 @@ define(function() {
test('is a function', function() {
expect(1);
stop();
- require(['jquery'], function($) {
+ require(['lodash'], function(_) {
start();
- strictEqual(typeof $, 'function', 'is a function');
+ strictEqual(typeof _, 'function', 'is a function');
});
});

0 comments on commit 152e689

Please sign in to comment.