mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 03:26:30 +02:00
Merge pull request #1223 from itelo/gulp
feat(gulp): add wiredep gulp task
This commit is contained in:
12
bower.json
12
bower.json
@@ -14,5 +14,17 @@
|
||||
"angular-ui-router": "~0.2.18",
|
||||
"bootstrap": "~3.3.6",
|
||||
"owasp-password-strength-test": "~1.3.0"
|
||||
},
|
||||
"overrides": {
|
||||
"bootstrap": {
|
||||
"main": [
|
||||
"dist/css/bootstrap.css",
|
||||
"dist/css/bootstrap-theme.css",
|
||||
"less/bootstrap.less"
|
||||
]
|
||||
},
|
||||
"jquery": {
|
||||
"main": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,13 @@ module.exports = {
|
||||
client: {
|
||||
lib: {
|
||||
css: [
|
||||
// bower:css
|
||||
'public/lib/bootstrap/dist/css/bootstrap.css',
|
||||
'public/lib/bootstrap/dist/css/bootstrap-theme.css'
|
||||
// endbower
|
||||
],
|
||||
js: [
|
||||
// bower:js
|
||||
'public/lib/angular/angular.js',
|
||||
'public/lib/angular-resource/angular-resource.js',
|
||||
'public/lib/angular-animate/angular-animate.js',
|
||||
@@ -16,6 +19,7 @@ module.exports = {
|
||||
'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
|
||||
'public/lib/angular-file-upload/dist/angular-file-upload.js',
|
||||
'public/lib/owasp-password-strength-test/owasp-password-strength-test.js'
|
||||
// endbower
|
||||
],
|
||||
tests: ['public/lib/angular-mocks/angular-mocks.js']
|
||||
},
|
||||
|
||||
@@ -4,10 +4,13 @@ module.exports = {
|
||||
client: {
|
||||
lib: {
|
||||
css: [
|
||||
// bower:css
|
||||
'public/lib/bootstrap/dist/css/bootstrap.min.css',
|
||||
'public/lib/bootstrap/dist/css/bootstrap-theme.min.css',
|
||||
// endbower
|
||||
],
|
||||
js: [
|
||||
// bower:js
|
||||
'public/lib/angular/angular.min.js',
|
||||
'public/lib/angular-resource/angular-resource.min.js',
|
||||
'public/lib/angular-animate/angular-animate.min.js',
|
||||
@@ -16,6 +19,7 @@ module.exports = {
|
||||
'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js',
|
||||
'public/lib/angular-file-upload/dist/angular-file-upload.min.js',
|
||||
'public/lib/owasp-password-strength-test/owasp-password-strength-test.js'
|
||||
// endbower
|
||||
]
|
||||
},
|
||||
css: 'public/dist/application.min.css',
|
||||
|
||||
44
gulpfile.js
44
gulpfile.js
@@ -215,6 +215,48 @@ gulp.task('imagemin', function () {
|
||||
.pipe(gulp.dest('public/dist/img'));
|
||||
});
|
||||
|
||||
// wiredep task to default
|
||||
gulp.task('wiredep', function () {
|
||||
return gulp.src('config/assets/default.js')
|
||||
.pipe(plugins.wiredep({
|
||||
ignorePath: '../../'
|
||||
}))
|
||||
.pipe(gulp.dest('config/assets/'));
|
||||
});
|
||||
|
||||
// wiredep task to production
|
||||
gulp.task('wiredep:prod', function () {
|
||||
return gulp.src('config/assets/production.js')
|
||||
.pipe(plugins.wiredep({
|
||||
ignorePath: '../../',
|
||||
fileTypes: {
|
||||
js: {
|
||||
replace: {
|
||||
css: function (filePath) {
|
||||
var minFilePath = filePath.replace('.css', '.min.css');
|
||||
var fullPath = path.join(process.cwd(), minFilePath);
|
||||
if (!fs.existsSync(fullPath)) {
|
||||
return '\'' + filePath + '\',';
|
||||
} else {
|
||||
return '\'' + minFilePath + '\',';
|
||||
}
|
||||
},
|
||||
js: function (filePath) {
|
||||
var minFilePath = filePath.replace('.js', '.min.js');
|
||||
var fullPath = path.join(process.cwd(), minFilePath);
|
||||
if (!fs.existsSync(fullPath)) {
|
||||
return '\'' + filePath + '\',';
|
||||
} else {
|
||||
return '\'' + minFilePath + '\',';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('config/assets/'));
|
||||
});
|
||||
|
||||
// Copy local development environment config example
|
||||
gulp.task('copyLocalEnvConfig', function () {
|
||||
var src = [];
|
||||
@@ -339,7 +381,7 @@ gulp.task('lint', function (done) {
|
||||
|
||||
// Lint project files and minify them into two production files.
|
||||
gulp.task('build', function (done) {
|
||||
runSequence('env:dev', 'lint', ['uglify', 'cssmin'], done);
|
||||
runSequence('env:dev', 'wiredep:prod', 'lint', ['uglify', 'cssmin'], done);
|
||||
});
|
||||
|
||||
// Run the project tests
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"lodash": "~4.3.0",
|
||||
"lusca": "~1.3.0",
|
||||
"method-override": "~2.3.5",
|
||||
"gulp-wiredep": "~0.0.0",
|
||||
"mocha": "~2.4.5",
|
||||
"mongoose": "~4.4.3",
|
||||
"morgan": "~1.6.1",
|
||||
|
||||
Reference in New Issue
Block a user