Skip to content

Commit 2364178

Browse files
committed
fix(gulp): Make wiredep work for the bower task, and refactor a few path variables
1 parent 1d5fd55 commit 2364178

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

app/templates/gulpfile.babel.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ var plugins = gulpLoadPlugins();
1616
var config;
1717

1818
var yeoman = {
19-
app: require('./bower.json').appPath || 'app',
20-
dist: 'dist'
19+
app: require('./bower.json').appPath || 'client/app'
2120
};
2221

2322
var paths = {
@@ -37,7 +36,8 @@ var paths = {
3736
'client/bower_components/angular-route/angular-route.js',<% if(filters.coffee) { %>
3837
'client/**/*.spec.coffee'<% } else { %>
3938
'client/**/*.spec.js'<% } %>
40-
]
39+
],
40+
bower: 'client/bower_components/'
4141
},
4242
server: {<% if(filters.coffee) { %>
4343
scripts: ['server/**/*.coffee'],
@@ -47,12 +47,13 @@ var paths = {
4747

4848
},
4949
views: {<% if(filters.jade) { %>
50-
main: 'client/app/index.jade',
50+
main: 'client/index.jade',
5151
files: ['client/app/**/*.jade']<% } else {%>
52-
main: 'client/app/index.html',
52+
main: 'client/index.html',
5353
files: ['client/app/**/*.html']<% } %>
5454
},
55-
karma: 'karma.conf.js'
55+
karma: 'karma.conf.js',
56+
dist: 'dist'
5657
};
5758

5859
//////////////////////
@@ -174,6 +175,7 @@ gulp.task('watch', function () {
174175
gulp.task('serve', function (callback) {
175176
runSequence('clean:tmp',
176177
['lint:scripts'],
178+
'bower',
177179
['start:server', 'start:client'],
178180
'watch', callback);
179181
});
@@ -197,10 +199,9 @@ gulp.task('test:client', function () {
197199
gulp.task('bower', function () {
198200
return gulp.src(paths.views.main)
199201
.pipe(wiredep({
200-
directory: yeoman.app + '/bower_components',
201-
ignorePath: '..'
202+
exclude: [/bootstrap-sass-official/, /bootstrap.js/, '/json3/', '/es5-shim/', /bootstrap.css/, /font-awesome.css/ ]
202203
}))
203-
.pipe(gulp.dest(yeoman.app + '/views/'));
204+
.pipe(gulp.dest('client/'));
204205
});
205206

206207
///////////
@@ -237,12 +238,12 @@ gulp.task('client:build', ['html'], function () {
237238
.pipe(plugins.revReplace())
238239
.pipe(plugins.useref())<% if(filters.jade) { %>
239240
.pipe(assets)<% } %>
240-
.pipe(gulp.dest(yeoman.dist + '/public'));
241+
.pipe(gulp.dest(paths.dist + '/public'));
241242
});
242243

243244
gulp.task('html', function () {
244245
return gulp.src(yeoman.app + '/views/**/*')
245-
.pipe(gulp.dest(yeoman.dist + '/public/views'));
246+
.pipe(gulp.dest(paths.dist + '/public/views'));
246247
});
247248

248249
gulp.task('images', function () {
@@ -252,23 +253,23 @@ gulp.task('images', function () {
252253
progressive: true,
253254
interlaced: true
254255
})))
255-
.pipe(gulp.dest(yeoman.dist + '/public/images'));
256+
.pipe(gulp.dest(paths.dist + '/public/images'));
256257
});
257258

258259
gulp.task('copy:extras', function () {
259260
return gulp.src(yeoman.app + '/*.*', { dot: true })
260-
.pipe(gulp.dest(yeoman.dist + '/public'));
261+
.pipe(gulp.dest(paths.dist + '/public'));
261262
});
262263

263264
gulp.task('copy:fonts', function () {
264265
return gulp.src(yeoman.app + '/fonts/**/*')
265-
.pipe(gulp.dest(yeoman.dist + '/fonts'));
266+
.pipe(gulp.dest(paths.dist + '/fonts'));
266267
});
267268

268269
gulp.task('copy:server', function(){
269270
return gulp.src([
270271
'package.json',
271272
'server.js',
272273
'lib/**/*'
273-
], {cwdbase: true}).pipe(gulp.dest(yeoman.dist));
274+
], {cwdbase: true}).pipe(gulp.dest(paths.dist));
274275
});

0 commit comments

Comments
 (0)