【发布时间】:2013-10-10 13:25:55
【问题描述】:
我想用 grunt.js 将/pckg 的内容复制到/dist。
这是结构:
|-- folder1
| |
| |-- folder2
| |
| |-- pckg
| |
| |--myfolder
| | |
| | |-- myfiles
| |
| |--myfiles
|
|
|-- dist
|
|--myfolder
| |
| |-- myfiles
|
|--myfiles
这是我的Gruntfile.js
module.exports = function (grunt) {
// Package configuration
grunt.initConfig({
// Metadata
pkg: grunt.file.readJSON('package.json'),
//Copy files
copy: {
main: {
expand: true,
src: 'folder1/folder2/pckg/**',
dest: 'dest/'
}
}
});
// Load the plugin that provides the "copy" task.
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s).
grunt.registerTask('default', ['copy']);
};
当我运行 Grunt 时,它会保持路径。它会复制dit/folder1/folder2/pckg 中的所有内容。
怎么了?
感谢您的帮助!
【问题讨论】:
标签: gruntjs grunt-contrib-copy