Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我能';不要让Grunt源地图在foundation press主题中工作_Javascript_Node.js_Gruntjs_Npm_Zurb Foundation - Fatal编程技术网

Javascript 我能';不要让Grunt源地图在foundation press主题中工作

Javascript 我能';不要让Grunt源地图在foundation press主题中工作,javascript,node.js,gruntjs,npm,zurb-foundation,Javascript,Node.js,Gruntjs,Npm,Zurb Foundation,我在为npm包grunt sass获取源地图时遇到困难 这是我的Grunfile.js 这是不工作的部分sourceMap:true,第13行 module.exports = function(grunt) { var jsApp = [ 'js/app.js', 'js/_*.js' ]; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: {

我在为npm包grunt sass获取源地图时遇到困难

这是我的Grunfile.js

这是不工作的部分
sourceMap:true,
第13行

module.exports = function(grunt) {
    var jsApp = [
    'js/app.js',
    'js/_*.js'
  ];

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),


      sass: {
        options: {
            sourceMap: true,
            includePaths: ['bower_components/foundation/scss']
        },
        dist: {
            files: {
                'css/app.css': 'scss/app.scss'
                }
            }
        },


    autoprefixer: {
        dist: {
            files: {
                'css/app.css': 'css/app.css'
            }
        },
      watch: {
          styles: {
              files: ['css/app.css'],
              tasks: ['autoprefixer']
          }
        }
      },

    copy: {
      scripts: {
        expand: true,
        cwd: 'bower_components/',
        src: '**/*.js',
        dest: 'js'
      },

      maps: {
        expand: true,
        cwd: 'bower_components/',
        src: '**/*.map',
        dest: 'js'
      }
    },

    uglify: {
      dist: {
        files: {
          'js/modernizr/modernizr.min.js': ['js/modernizr/modernizr.js']
        }
      }
    },

    concat: {
      options: {

        separator: ';'
      },
    dist: {
        src: [
          'js/foundation/js/foundation.min.js',
          'js/custom/*.js'
        ],

        dest: 'js/app.js'
      }

    }



  });

  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-autoprefixer');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.registerTask('default', ['sass']);



};
mypackage.json

{
  "name": "grunt-sass",
  "version": "0.8.1",
  "description": "Compile SCSS to CSS using node-sass",
  "keywords": [
    "gruntplugin",
    "css",
    "sass",
    "scss",
    "style",
    "compile",
    "preprocess"
  ],
  "homepage": "https://github.com/sindresorhus/grunt-sass",
  "bugs": {
    "url": "https://github.com/sindresorhus/grunt-sass/issues"
  },
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "http://sindresorhus.com"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/sindresorhus/grunt-sass.git"
  },
  "scripts": {
    "test": "grunt"
  },
  "dependencies": {
    "node-sass": "~0.7.0",
    "async": "~0.2.9"
  },
  "devDependencies": {
    "grunt": "~0.4.0",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-nodeunit": "~0.2.2"
  },
  "peerDependencies": {
    "grunt": "~0.4.0"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "licenses": {
    "type": "MIT"
  },
  "files": [
    "tasks/sass.js"
  ],
  "_id": "grunt-sass@0.8.1",
  "dist": {
    "shasum": "694a0fe351af3466079e138b2c70afe2f46a5618",
    "tarball": "http://registry.npmjs.org/grunt-sass/-/grunt-sass-0.8.1.tgz"
  },
  "_from": "grunt-sass@>=0.8.0 <0.9.0",
  "_npmVersion": "1.3.14",
  "_npmUser": {
    "name": "sindresorhus",
    "email": "sindresorhus@gmail.com"
  },
  "maintainers": [
    {
      "name": "sindresorhus",
      "email": "sindresorhus@gmail.com"
    }
  ],
  "directories": {},
  "_shasum": "694a0fe351af3466079e138b2c70afe2f46a5618",
  "_resolved": "https://registry.npmjs.org/grunt-sass/-/grunt-sass-0.8.1.tgz"
}
{
“名称”:“咕噜沙斯”,
“版本”:“0.8.1”,
“说明”:“使用节点sass将SCS编译为CSS”,
“关键词”:[
“gruntplugin”,
“css”,
“sass”,
“scss”,
“风格”,
“编译”,
“预处理”
],
“主页”:https://github.com/sindresorhus/grunt-sass",
“臭虫”:{
“url”:”https://github.com/sindresorhus/grunt-sass/issues"
},
“作者”:{
“姓名”:“Sindre Sorhus”,
“电子邮件”:sindresorhus@gmail.com",
“url”:”http://sindresorhus.com"
},
“存储库”:{
“类型”:“git”,
“url”:”git://github.com/sindresorhus/grunt-sass.git"
},
“脚本”:{
“测试”:“咕噜”
},
“依赖项”:{
“节点sass”:“~0.7.0”,
“异步”:“~0.2.9”
},
“依赖性”:{
“咕噜”:“~0.4.0”,
“grunt contrib clean”:“~0.5.0”,
“grunt contrib nodeunit”:“~0.2.2”
},
“对等关系”:{
“咕噜”:“~0.4.0”
},
“发动机”:{
“节点”:“>=0.10.0”
},
“许可证”:{
“类型”:“MIT”
},
“文件”:[
“任务/sass.js”
],
“_id”:“咕噜”-sass@0.8.1",
“地区”:{
“shasum”:“694a0fe351af3466079e138b2c70afe2f46a5618”,
“柏油球”:http://registry.npmjs.org/grunt-sass/-/grunt-sass-0.8.1.tgz"
},

“_from”:“grunt sass@>=0.8.0请使用官方
grunt contrib sass
软件包。您可以在此处找到它:

安装并加载后,您可以执行以下操作:

sass: {
  options: {
    sourcemap: true,
    style: 'compressed'
  },

  dist: {
    files: [{
      expand: true,
      cwd: 'css/scss',
      src: ['*.scss'],
      dest: './css',
      ext: '.css'
    }]
  }
}
请确保加载以下内容:

grunt.loadNpmTasks('grunt-contrib-sass');