【问题标题】:Yeoman/Grunt clean:dist task property undefinedYeoman/Grunt clean:dist 任务属性未定义
【发布时间】:2014-09-10 17:39:03
【问题描述】:

我是 grunt 的新手,在处理 grunt-contrib-clean 的 clean:dist 任务时遇到了麻烦。这是我的任务代码。

clean: {
    dist: {
        files: [{
            dot: true,
            src: [
                '.tmp',
                '<%= yeoman.dist %>/*',
                '!<%= yeoman.dist %>/.git*',
                '!<%= yeoman.dist %>/Procfile',
                '!<%= yeoman.dist %>/package.json',
                '!<%= yeoman.dist %>/web.js',
                '!<%= yeoman.dist %>/node_modules'
           ]
        }]
    },
    server: '.tmp'
},

当我运行 grunt build 时,我收到以下警告“处理模板时发生错误(无法读取未定义的属性 'dist')。使用 --force 继续。”我认为这一定是语法错误或插件有问题,但我知道的不够多,无法继续弄清楚。

【问题讨论】:

    标签: gruntjs yeoman


    【解决方案1】:

    出于某种原因,从 更改为 解决了我的问题。不确定何时使用 yeoman.dist 语法是否合适,但无论如何我解决了自己的问题。所以解决方案是......

    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= config.dist %>/*',
            '!<%= config.dist %>/.git*',
            '!<%= config.dist %>/Procfile',
            '!<%= config.dist %>/package.json',
            '!<%= config.dist %>/web.js',
            '!<%= config.dist %>/node_modules'
          ]
        }]
      },
      server: '.tmp'
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-12
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多