簡體   English   中英

grunt-injector-如何使用Grunt的“動態構建文件對象”?

[英]grunt-injector - how to use Grunt's 'dynamically built files objects.'?

Grunt動態構建的文件對象的結構如下:

files: [
        {
          expand: true,     // Enable dynamic expansion.
          cwd: 'lib/',      // Src matches are relative to this path.
          src: ['**/*.js'], // Actual pattern(s) to match.
          dest: 'build/',   // Destination path prefix.
          ext: '.min.js',   // Dest filepaths will have this extension.
          extDot: 'first'   // Extensions in filenames begin after the first dot
        },
]

但是這種格式在grunt-injector中不起作用:

injector: {
    options: {
    destFile : 'app/static/index.html',
    ignorePath: 'app/'
    }, 
    local_dependencies: {
    files:  [
            expand: true,
            cwd: 'app/static/css/',
            src: ['*.css'],
            dest: '/static/css',
            ext: '.css'
            ]  
    }  
}, 

關於如何將Grunt的特定“動態構建文件對象”與之配合使用的任何建議?

如果有人遇到此問題,我想您不能使用像local_dependencies這樣的子類別。

這為我工作:

    injector: {
        options: {
        destFile : 'app/static/index.html',
        ignorePath: 'app/'
        }, 
            files: {
                expand: true,
                cwd: 'app/static/css/',
                src: ['*.css'],
                dest: 'app/static/css',
                ext: '.css'
                }
    }, 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM