我想复制内容/pckg
to /dist
与 grunt.js。
结构如下:
|-- 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
。
怎么了 ?
感谢您的帮助 !
这是我用过的:
copy: {
main: {
expand: true,
cwd: 'folder1/folder2/pckg/',
src: ['**'],
dest: 'dist/'
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)