Skip to content

Commit

Permalink
now we are talking, it can be shrunked
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Aug 17, 2013
1 parent 637cbbc commit 69e31d2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 60 deletions.
59 changes: 5 additions & 54 deletions Gruntfile.js
Expand Up @@ -25,14 +25,6 @@ module.exports = function (grunt) {
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.coffee'],
tasks: ['coffee:test']
},
compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer']
Expand Down Expand Up @@ -70,16 +62,6 @@ module.exports = function (grunt) {
}
}
},
test: {
options: {
middleware: function (connect) {
return [
mountFolder(connect, '.tmp'),
mountFolder(connect, 'test')
];
}
}
},
dist: {
options: {
middleware: function (connect) {
Expand Down Expand Up @@ -108,34 +90,6 @@ module.exports = function (grunt) {
},
server: '.tmp'
},
mocha: {
all: {
options: {
run: true,
urls: ['http://localhost:<%= connect.options.port %>/index.html']
}
}
},
coffee: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/scripts',
src: '{,*/}*.coffee',
dest: '.tmp/scripts',
ext: '.js'
}]
},
test: {
files: [{
expand: true,
cwd: 'test/spec',
src: '{,*/}*.coffee',
dest: '.tmp/spec',
ext: '.js'
}]
}
},
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
Expand Down Expand Up @@ -184,13 +138,14 @@ module.exports = function (grunt) {
// Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
options: {
// `name` and `out` is set by grunt-usemin
baseUrl: yeomanConfig.app + '/scripts',
baseUrl: yeomanConfig.app,
optimize: 'none',
// TODO: Figure out how to make sourcemaps work with grunt-usemin
// https://github.com/yeoman/grunt-usemin/issues/30
//generateSourceMaps: true,
// required to support SourceMaps
// http://requirejs.org/docs/errors.html#sourcemapcomments
name: "scripts/main",
preserveLicenseComments: false,
useStrict: true,
wrap: true
Expand Down Expand Up @@ -262,15 +217,15 @@ module.exports = function (grunt) {
htmlmin: {
dist: {
options: {
/*removeCommentsFromCDATA: true,
removeCommentsFromCDATA: true,
// https://github.com/yeoman/grunt-usemin/issues/44
//collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeOptionalTags: true*/
removeOptionalTags: true
},
files: [{
expand: true,
Expand Down Expand Up @@ -307,15 +262,12 @@ module.exports = function (grunt) {
concurrent: {
server: [
'compass',
'coffee:dist',
'copy:styles'
],
test: [
'coffee',
'copy:styles'
],
dist: [
'coffee',
'compass',
'copy:styles',
'imagemin',
Expand Down Expand Up @@ -352,8 +304,6 @@ module.exports = function (grunt) {
'clean:server',
'concurrent:test',
'autoprefixer',
'connect:test',
'mocha'
]);

grunt.registerTask('build', [
Expand All @@ -362,6 +312,7 @@ module.exports = function (grunt) {
'concurrent:dist',
'autoprefixer',
'requirejs',

'concat',
'cssmin',
'uglify',
Expand Down
10 changes: 5 additions & 5 deletions app/.htaccess
Expand Up @@ -499,11 +499,11 @@ FileETag None
# To understand why this is important and a better idea than `*.css?v231`, read:
# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring

# <IfModule mod_rewrite.c>
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
# </IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
</IfModule>

# ------------------------------------------------------------------------------
# | File concatenation |
Expand Down
6 changes: 6 additions & 0 deletions app/index.html
Expand Up @@ -6,10 +6,16 @@
<title>Recently</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- build:css(.tmp) styles/css.css -->
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
<!-- build:js scripts/modernizr.js -->
<script src="bower_components/modernizr/modernizr.js"></script>
<!-- endbuild -->
<!-- build:js scripts/js.js -->
<script data-main="scripts/main" src="bower_components/requirejs/require.js"></script>
<!-- endbuild -->
</head>
<body>
<!--[if lt IE 7]>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -26,7 +26,8 @@
"grunt-svgmin": "~0.1.0",
"grunt-concurrent": "~0.1.0",
"matchdep": "~0.1.1",
"connect-livereload": "~0.2.0"
"connect-livereload": "~0.2.0",
"grunt-cachebuster": "~0.1.5"
},
"engines": {
"node": ">=0.8.0"
Expand Down

0 comments on commit 69e31d2

Please sign in to comment.