首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >警告:扁平不是一种功能使用--继续使用武力。

警告:扁平不是一种功能使用--继续使用武力。
EN

Stack Overflow用户
提问于 2019-12-03 11:22:44
回答 1查看 690关注 0票数 1

我的咕噜声有很奇怪的错误。由于某种原因,在我们的CI系统中运行了一段时间后,这项任务开始失败。可能是面临同样问题的人?

当我运行grunt :site时,它会输出:

代码语言:javascript
复制
Running "assemble:site" (assemble) task
Warning: flatten is not a function Use --force to continue.

如何修复此错误?任务中的一些配置问题?

Gruntfile.js装配任务部件

代码语言:javascript
复制
module.exports = function(grunt) {
    grunt.initConfig({

        //other tasks
        assemble: {
            options: {
                production: true,
                ext: '.html',
                data: 'src/data/*.json',
                assets: 'dist/assets',
                helpers: 'src/helpers/*-helper.js',
                layoutdir: 'src/templates/layouts',
                partials: ['src/templates/partials/*.hbs']
            },
            site: {
                options: {
                    layout: 'default.hbs'
                },
                files: [{
                    expand: true,
                    cwd: 'src/templates/pages',
                    src: ['*.hbs'],
                    dest: 'dist/'
                }]
            }
        },

        //other tasks

    });

    //other loadNpmTasks

    grunt.loadNpmTasks('grunt-assemble');

    //other registerTask

    grunt.registerTask('build', [
        'concat:bootstrap',
        'concat:js',
        'uglify:js',
        'copy:js',
        'assemble',
        'prettify',
        'sprite',
        'svgmin',
        'sass',
        'postcss',
        'copy:gfx',
        'pngmin'
    ]);
}

Package.json文件:

代码语言:javascript
复制
{
  "name": "html-prototype",
  "version": "1.0.0",
  "description": "HTML prototype",
  "devDependencies": {
    "autoprefixer": "^6.7.2",
    "grunt": "^1.0.0",
    "grunt-assemble": "^0.6.3",
    "grunt-autoprefixer": "^3.0.4",
    "grunt-contrib-concat": "^1.0.1",
    "grunt-contrib-copy": "^1.0.0",
    "grunt-contrib-uglify": "^2.0.0",
    "grunt-contrib-watch": "^1.0.0",
    "grunt-newer": "^1.1.0",
    "grunt-pngmin": "^1.0.2",
    "grunt-postcss": "^0.8.0",
    "grunt-prettify": "0.4.0",
    "grunt-sass": "^2.0.0",
    "grunt-string-replace": "^1.3.1",
    "grunt-svg-sprite": "1.4.0",
    "grunt-svgmin": "^4.0.0",
    "node-sass": "~4.5.0",
    "postcss-placehold": "^1.2.0",
    "postcss-svg": "^1.0.6",
    "svg-sprite": "1.4.0"
  },
  "dependencies": {
    "digits": "~0.2.0"
  },
  "scripts": {
    "grunt-build": "grunt build"
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-05 07:11:44

这是包本身的一些问题。这里有更多的信息

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59155976

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档