Javascript 使用Sails.js管理前端依赖关系的传统方法是什么?
我目前正在一个Sails.js项目中使用bower,我发现这个库非常完整和有用。但是,有时仍然需要手动拾取或排除文件 所以我想知道是否存在另一种更传统的方法来管理Sails.js项目中的前端依赖关系 谢谢 编辑: 对于那些想知道的人,我的任务是:Javascript 使用Sails.js管理前端依赖关系的传统方法是什么?,javascript,gruntjs,sails.js,bower,Javascript,Gruntjs,Sails.js,Bower,我目前正在一个Sails.js项目中使用bower,我发现这个库非常完整和有用。但是,有时仍然需要手动拾取或排除文件 所以我想知道是否存在另一种更传统的方法来管理Sails.js项目中的前端依赖关系 谢谢 编辑: 对于那些想知道的人,我的任务是: module.exports = function(grunt) { grunt.config.set('bower', { dev: { dest: '.tmp/public', js_dest: '.tmp/pu
module.exports = function(grunt) {
grunt.config.set('bower', {
dev: {
dest: '.tmp/public',
js_dest: '.tmp/public/js/dependencies',
css_dest: '.tmp/public/styles',
fonts_dest: '.tmp/public/fonts',
less_dest: '.tmp/dontpublish',
scss_dest: '.tmp/dontpublish',
options: {
keepExpandedHierarchy: false,
stripGlobBase: false,
packageSpecific: {
'bootstrap': {
files: [
'fonts/glyphicons-halflings-regular.eot',
'fonts/glyphicons-halflings-regular.svg',
'fonts/glyphicons-halflings-regular.ttf',
'fonts/glyphicons-halflings-regular.woff',
'fonts/glyphicons-halflings-regular.woff2',
'dist/js/bootstrap.js'
]
}
}
}
}
});
grunt.loadNpmTasks('grunt-bower');
};
如您所见,我必须手动包含一些用于引导的文件,并将less和scss文件放在“未发布”文件夹中以排除它们。这没什么大不了的,但我只是想知道是否存在更好的配置,或者我的配置不好。您能更好地解释一下您的需求吗?您需要手动管理哪些类型的文件?根据我的经验,一个好的grunt配置可以帮助你完成这类任务。你是对的,也许我没有一个好的grunt配置。我将编辑我的帖子。