diff --git a/.gitignore b/.gitignore index 201ce0c..8c1abd4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ node_modules/ temp/ -.DS_Store \ No newline at end of file +.DS_Store + +# webstorm files +.idea \ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..cab819f --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/README.md b/README.md index 7c9d0f0..dd2485c 100755 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ Importantly, grunt-dom-munger uses CSS attribute selectors to manage the parsing Release History ------------- +* 6/10/2014 - v3.1.1 - Fix for backslashes being used in injected routes/tags on subgenerators. * 5/1/2014 - v3.1.0 - New subgenerators for modules and modals. Replaced grunt-contrib-jasmine with grunt-karma. Karma allows us to test against actual browsers other than PhantomJS. * 3/10/2014 - v3.0.2 - Fix for directive files not being named correctly. Fix for htmlmin from affecting some Bootstrap styles. * 3/03/2014 - v3.0.0 - All subgenerators now ask the user for a directory enabling any user-defined project structure. Gruntfile has been altered to allow scripts, partials, and LESS files to be located anywhere in the project directory structure. An option to use `angular-ui-router` is now available when initializing a new project. `js/setup.js` and `css/app.less` moved to `app.js` and `app.less`. `grunt server` is now `grunt serve`. Inside `index.html` all user script tags are grouped together instead of split out into groups for services/filters/etc. New ability to customize the subgenerators. diff --git a/app/templates/Gruntfile.js b/app/templates/Gruntfile.js index 7f543e9..abf23be 100755 --- a/app/templates/Gruntfile.js +++ b/app/templates/Gruntfile.js @@ -51,7 +51,7 @@ module.exports = function (grunt) { livereloadOnError: false, spawn: false }, - files: [createFolderGlobs(['*.js','*.less','*.html']),'!_SpecRunner.html','!.grunt'], + files: [createFolderGlobs(['*.js','*.less','*.s?ss','*.html']),'!_SpecRunner.html','!.grunt'], tasks: [] //all the tasks are run dynamically during the watch event handler } }, @@ -70,7 +70,17 @@ module.exports = function (grunt) { after: { src:['temp'] } - }, + },<% if (css == 'Sass') { %> + sass: { + production: { + options: { + sourceComments: "map" + }, + files: { + 'temp/app.css': 'app.scss' + } + } + },<% } else { %> less: { production: { options: { @@ -79,7 +89,7 @@ module.exports = function (grunt) { 'temp/app.css': 'app.less' } } - }, + },<% } %> ngtemplates: { main: { options: { @@ -194,7 +204,7 @@ module.exports = function (grunt) { } }); - grunt.registerTask('build',['jshint','clean:before','less','dom_munger','ngtemplates','cssmin','concat','ngmin','uglify','copy','htmlmin','imagemin','clean:after']); + grunt.registerTask('build',['jshint','clean:before','<%= _.slugify(css) %>','dom_munger','ngtemplates','cssmin','concat','ngmin','uglify','copy','htmlmin','imagemin','clean:after']); grunt.registerTask('serve', ['dom_munger:read','jshint','connect', 'watch']); grunt.registerTask('test',['dom_munger:read','karma:all_tests']); @@ -225,6 +235,11 @@ module.exports = function (grunt) { } } + //if scss/sass file changed, we need to recompile for dev + if (filepath.lastIndexOf('.sass') !== -1 || filepath.lastIndexOf('.scss') !== -1) { + tasksToRun.push('sass'); + } + //if index.html changed, we need to reread the