【问题标题】:grunt-include-replace adding a folder when it compilesgrunt-include-replace 在编译时添加一个文件夹
【发布时间】:2017-12-31 12:59:16
【问题描述】:

我正想尽办法解决这个问题。我有 include replace 从 src 文件夹中提取并编译到 dist 文件夹中。它正在这样做,但是,它将一个 src 文件夹添加到 dist 文件夹中,并将 html 文件放入其中。如果我从根目录而不是 src 文件夹中提取,它工作得很好,并且只将 html 放入 dist 文件夹,没有额外的文件夹。为什么将路径添加到 src 文件夹中会在 dist 文件夹中创建另一个 src 文件夹,我该如何让它停止这样做?

我的代码是这样设置的...

    distdir: 'dist',
    srcdir: 'src',
    includereplace: {
        dist: {
            options: {
                includesDir: '<%= srcdir %>/includes/'
            },
            src: '<%= srcdir %>/*.html',
            dest: '<%= distdir %>'
        }
    }

【问题讨论】:

    标签: html gruntjs grunt-includes


    【解决方案1】:

    没关系。我想到了。我必须这样做:

    files: [
        {
            src: '*.html',
            dest: '<%= distdir %>/',
            expand: true,
            cwd: '<%= srcdir %>/'
        }
    ]
    

    【讨论】:

      猜你喜欢
      • 2013-11-23
      • 1970-01-01
      • 1970-01-01
      • 2017-06-12
      • 1970-01-01
      • 1970-01-01
      • 2013-07-21
      • 2016-03-13
      • 1970-01-01
      相关资源
      最近更新 更多