与我编写的所有其他节点项目不同,这个项目需要节点服务器的文件夹不是根目录。这是当前文件夹层次结构:
- Root/
- build/
- css/
- im/
- js/
- nodeserver/ <-- gruntfile and package are here
GruntFile.js
, package.json
, 和server.js
都位于nodeserver/
这是我的 GruntFile:
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
files: {
'../build/all.min.js':['../js/config.js']
},
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
report: true
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['uglify']);
};
当我运行 grunt 时,它找不到我指定的文件。这是回应:
Running "uglify:files" (uglify) task
------------------------------------
Verifying property uglify.files exists in config...OK
File: [no files]
Options: banner="/*! demo-webservice 2014-03-28 */\n", footer="", compress={"warnings":false}, mangle={}, beautify=false, report
为什么看不到我的js文件?