Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added option for custom dist folder #9

Open
wants to merge 1 commit into from

3 participants

@logstown

I really like this generator, but I noticed the lack of a custom dist folder in the Gruntfile.js

Thanks

@maxrevilo

Would be useful, I had to do a global replace.

@sdoxsee

Why hasn't this been accepted yet? I basically had to do this myself--defining a variable and replacing all "dist" with my var. This feature would have saved me time.

@sdoxsee sdoxsee referenced this pull request
Closed

Configurable dist #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 23, 2013
  1. added option for custom dist folder

    Logan Joecks authored
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 16 deletions.
  1. +23 −16 app/templates/skeleton/Gruntfile.js
View
39 app/templates/skeleton/Gruntfile.js
@@ -7,7 +7,14 @@ var folderMount = function folderMount(connect, point) {
module.exports = function (grunt) {
// Project configuration.
+
+ var yeomanConfig = {
+ dist: 'dist'
+ };
+
grunt.initConfig({
+ yeoman: yeomanConfig,
+
connect: {
main: {
options: {
@@ -35,7 +42,7 @@ module.exports = function (grunt) {
},
clean: {
before:{
- src:['dist','temp']
+ src:['<%= yeoman.dist %>','temp']
},
after: {
src:['temp']
@@ -62,12 +69,12 @@ module.exports = function (grunt) {
copy: {
main: {
files: [
- {src: ['index.html'], dest: 'dist/'},
- {src: ['img/**'], dest: 'dist/'},
- {src: ['bower_components/angular-ui/build/angular-ui-ieshiv.js'], dest: 'dist/'},
- {src: ['bower_components/font-awesome/build/assets/font-awesome/font/**'], dest: 'dist/',filter:'isFile',expand:true},
- // {src: ['bower_components/select2/*.png','bower_components/select2/*.gif'], dest:'dist/css/',flatten:true,expand:true},
- {src: ['bower_components/angular-mocks/angular-mocks.js'], dest: 'dist/'}
+ {src: ['index.html'], dest: '<%= yeoman.dist %>/'},
+ {src: ['img/**'], dest: '<%= yeoman.dist %>/'},
+ {src: ['bower_components/angular-ui/build/angular-ui-ieshiv.js'], dest: '<%= yeoman.dist %>/'},
+ {src: ['bower_components/font-awesome/build/assets/font-awesome/font/**'], dest: '<%= yeoman.dist %>/',filter:'isFile',expand:true},
+ // {src: ['bower_components/select2/*.png','bower_components/select2/*.gif'], dest:'<%= yeoman.dist %>/css/',flatten:true,expand:true},
+ {src: ['bower_components/angular-mocks/angular-mocks.js'], dest: '<%= yeoman.dist %>/'}
]
}
},
@@ -89,32 +96,32 @@ module.exports = function (grunt) {
remove:'script[data-remove!="exclude"]',
append:{selector:'head',html:'<script src="app.full.min.js"></script>'}
},
- src:'dist/index.html'
+ src:'<%= yeoman.dist %>/index.html'
},
addscript: {
options:{
append:{selector:'body',html:'<script src="app.full.min.js"></script>'}
},
- src:'dist/index.html'
+ src:'<%= yeoman.dist %>/index.html'
},
removecss: {
options:{
remove:'link',
append:{selector:'head',html:'<link rel="stylesheet" href="css/app.full.min.css">'}
},
- src:'dist/index.html'
+ src:'<%= yeoman.dist %>/index.html'
},
addcss: {
options:{
append:{selector:'head',html:'<link rel="stylesheet" href="css/app.full.min.css">'}
},
- src:'dist/index.html'
+ src:'<%= yeoman.dist %>/index.html'
}
},
cssmin: {
main: {
src:['temp/app.css','<%%= dom_munger.data.appcss %>'],
- dest:'dist/css/app.full.min.css'
+ dest:'<%= yeoman.dist %>/css/app.full.min.css'
}
},
concat: {
@@ -132,7 +139,7 @@ module.exports = function (grunt) {
uglify: {
main: {
src: 'temp/app.full.js',
- dest:'dist/app.full.min.js'
+ dest:'<%= yeoman.dist %>/app.full.min.js'
}
},
htmlmin: {
@@ -142,16 +149,16 @@ module.exports = function (grunt) {
collapseWhitespace: true
},
files: {
- 'dist/index.html': 'dist/index.html'
+ '<%= yeoman.dist %>/index.html': '<%= yeoman.dist %>/index.html'
}
}
},
imagemin: {
main:{
files: [{
- expand: true, cwd:'dist/',
+ expand: true, cwd:'<%= yeoman.dist %>/',
src:['**/{*.png,*.jpg}'],
- dest: 'dist/'
+ dest: '<%= yeoman.dist %>/'
}]
}
},
Something went wrong with that request. Please try again.