diff --git a/app/index.js b/app/index.js index eb347220e..82e3e0658 100644 --- a/app/index.js +++ b/app/index.js @@ -280,21 +280,6 @@ Generator.prototype.bootstrapFiles = function bootstrapFiles() { } this.copy('styles/' + mainFile, 'app/styles/' + mainFile); - var appendOptions = { - html: this.indexFile, - fileType: 'css', - optimizedPath: 'styles/main.css', - sourceFileList: files.map(function (file) { - return 'styles/' + file.replace('.scss', '.css'); - }), - searchPath: ['.tmp', 'app'] - }; - - if (this.jade) { - this.indexFile = appendFilesToJade(appendOptions); - } else { - this.indexFile = this.appendFiles(appendOptions); - } }; function generateJadeBlock(blockType, optimizedPath, filesBlock, searchPath, prefix) { @@ -428,16 +413,25 @@ Generator.prototype._injectDependencies = function _injectDependencies() { if (this.options['skip-install']) { console.log(howToInstall); } else { - wiredep({ - directory: 'app/bower_components', - bowerJson: JSON.parse(fs.readFileSync('./bower.json')), - ignorePath: 'app/', - htmlFile: 'app/index.html', - cssPattern: '' - }); + if (this.jade) { + wiredep({ + directory: 'app/bower_components', + bowerJson: JSON.parse(fs.readFileSync('./bower.json')), + ignorePath: 'app/', + htmlFile: 'app/views/index.jade', + cssPattern: '' + }); + } else { + wiredep({ + directory: 'app/bower_components', + bowerJson: JSON.parse(fs.readFileSync('./bower.json')), + ignorePath: 'app/', + htmlFile: 'app/views/index.html', + cssPattern: '' + }); + } } }; -}; Generator.prototype.serverFiles = function () { this.template('../../templates/express/server.js', 'server.js'); diff --git a/app/templates/styles/main.scss b/app/templates/styles/main.scss index 033261fe2..e0c75c603 100644 --- a/app/templates/styles/main.scss +++ b/app/templates/styles/main.scss @@ -1,7 +1,5 @@ <% if (compassBootstrap) { %>$icon-font-path: "/bower_components/sass-bootstrap/fonts/"; -@import 'sass-bootstrap/lib/bootstrap'; - <% } %>.browsehappy { margin: 0.2em 0; background: #ccc; diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index 04db7d284..db0b90494 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -71,7 +71,6 @@ module.exports = function (grunt) { files: ['<%%= yeoman.app %>/styles/{,*/}*.{scss,sass}'], tasks: ['compass:server', 'autoprefixer'] },<% } else { %> - },<% } %> styles: { files: ['<%%= yeoman.app %>/styles/{,*/}*.css'], tasks: ['newer:copy:styles', 'autoprefixer'] @@ -80,7 +79,6 @@ module.exports = function (grunt) { files: ['Gruntfile.js'] }, livereload: { - files: [ files: [ '<%%= yeoman.app %>/<%%= yeoman.views %>/{,*//*}*.{html,jade}', '{.tmp,<%%= yeoman.app %>}/styles/{,*//*}*.css', @@ -102,13 +100,6 @@ module.exports = function (grunt) { livereload: true, nospawn: true //Without this option specified express won't be reloaded } - }, - styles: { - files: ['<%%= yeoman.app %>/styles/{,*/}*.css'], - tasks: ['newer:copy:styles', 'autoprefixer'] - }, - gruntfile: { - files: ['Gruntfile.js'] } }, @@ -172,13 +163,13 @@ module.exports = function (grunt) { // Automatically inject Bower components into the app 'bower-install': { - app: { - html: '<%%= yeoman.app %>/index.html', + app: {<% if (jade) { %> + html: '<%%= yeoman.app %>/views/index.jade',<% } else { %> + html: '<%%= yeoman.app %>/views/index.html',<% } %> ignorePath: '<%%= yeoman.app %>/' } }, - -<% if (coffee) { %> + <% if (coffee) { %> // Compiles CoffeeScript to JavaScript coffee: { options: { @@ -204,8 +195,7 @@ module.exports = function (grunt) { }] } },<% } %> - -<% if (compass) { %> + <% if (compass) { %> // Compiles Sass to CSS and generates necessary files if requested compass: { options: { @@ -220,7 +210,8 @@ module.exports = function (grunt) { httpGeneratedImagesPath: '/images/generated', httpFontsPath: '/styles/fonts', relativeAssets: false, - assetCacheBuster: false + assetCacheBuster: false, + raw: 'Sass::Script::Number.precision = 10\n' }, dist: { options: { @@ -293,10 +284,10 @@ module.exports = function (grunt) { htmlmin: { dist: { options: { - collapseWhitespace: true, - collapseBooleanAttributes: true, - removeCommentsFromCDATA: true, - removeOptionalTags: true + //collapseWhitespace: true, + //collapseBooleanAttributes: true, + //removeCommentsFromCDATA: true, + //removeOptionalTags: true }, files: [{ expand: true, @@ -338,8 +329,6 @@ module.exports = function (grunt) { src: [ '*.{ico,png,txt}', '.htaccess', - '*.html', - 'views/{,*/}*.html', 'bower_components/**/*', 'images/{,*/}*.{webp}', 'fonts/**/*' @@ -375,7 +364,7 @@ module.exports = function (grunt) { 'lib/**/*' ] }] - }, + }, styles: { expand: true, cwd: '<%%= yeoman.app %>/styles', @@ -401,7 +390,8 @@ module.exports = function (grunt) { 'compass:dist',<% } else { %> 'copy:styles',<% } %> 'imagemin', - 'svgmin' + 'svgmin', + 'htmlmin' ] }, @@ -485,14 +475,13 @@ module.exports = function (grunt) { 'cssmin', 'uglify', 'rev', - 'usemin', - 'htmlmin' + 'usemin' ]); grunt.registerTask('heroku', [ 'build', 'clean:heroku', - 'copy:heroku' + 'copy:heroku' ]); grunt.registerTask('default', [ diff --git a/templates/common/_bower.json b/templates/common/_bower.json index ae8068a29..48cf85667 100644 --- a/templates/common/_bower.json +++ b/templates/common/_bower.json @@ -2,19 +2,19 @@ "name": "<%= _.slugify(_.humanize(appname)) %>", "version": "0.0.0", "dependencies": { - "angular": "~1.2.5", + "angular": "1.2.5", "json3": "~3.2.6", "es5-shim": "~2.1.0"<% if (bootstrap) { %>, "jquery": "~1.10.2"<% if (compassBootstrap) { %>, "sass-bootstrap": "~3.0.2"<% } else { %>, "bootstrap": "~3.0.3"<% } } %><% if (resourceModule) { %>, - "angular-resource": "~1.2.5"<% } %><% if (cookiesModule) { %>, - "angular-cookies": "~1.2.5"<% } %><% if (sanitizeModule) { %>, - "angular-sanitize": "~1.2.5"<% } %><% if (routeModule) { %>, - "angular-route": "~1.2.5"<% } %> + "angular-resource": "1.2.5"<% } %><% if (cookiesModule) { %>, + "angular-cookies": "1.2.5"<% } %><% if (sanitizeModule) { %>, + "angular-sanitize": "1.2.5"<% } %><% if (routeModule) { %>, + "angular-route": "1.2.5"<% } %> }, "devDependencies": { - "angular-mocks": "~1.2.5", - "angular-scenario": "~1.2.5" + "angular-mocks": "1.2.5", + "angular-scenario": "1.2.5" } } diff --git a/templates/views/html/index.html b/templates/views/html/index.html index 2c216adb5..66b5fd1a3 100644 --- a/templates/views/html/index.html +++ b/templates/views/html/index.html @@ -47,7 +47,7 @@ - + diff --git a/templates/views/jade/index.jade b/templates/views/jade/index.jade index 6cd4f86aa..fd4569ec8 100644 --- a/templates/views/jade/index.jade +++ b/templates/views/jade/index.jade @@ -13,7 +13,13 @@ html.no-js meta(name="description", content="") meta(name="viewport", content="width=device-width") // Place favicon.ico and apple-touch-icon.png in the root directory - //- build:head + + + + + + + body(ng-app="<%= scriptAppName %>") //[if lt IE 7]>
You are using an outdated browser. Upgrade your browser today or install Google Chrome Frame to better experience this site.
@@ -33,7 +39,7 @@ html.no-js g.src='//www.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); - <% if (bootstrap) { %>script(src="bower_components/jquery/jquery.js")<% } %> - script(src="bower_components/angular/angular.js") - - //- build:body \ No newline at end of file + + + +