简体   繁体   中英

How can I adjust the path to my destination folder?

I'm trying to configure the 'dest' property of uglify (grunt), but I'm having a problem.

This is my code:

    uglify:{
        js: {
            files: [{
                expand: true,
                src: ['js-dev/*.js','js-dev/**/*.js'],
                dest: 'js',
            }]
        }
    }

The problem is when I run my grunt, the final destination folder is js/js-dev/[All my files] . But I just want js/[All my files] , without the js-dev .

Does anyone know how I can adjust this?

Thanks!!!

You need to set cwd to js-dev and drop it from your src declarations.

uglify:{
    js: {
        files: [{
            expand: true,
            cwd: 'js-dev',
            src: ['*.js','**/*.js'],
            dest: '../js',
        }]
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM