首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grunt Sass to CSS not building

Grunt Sass to CSS not building
EN

Stack Overflow用户
提问于 2016-12-28 05:28:13
回答 0查看 157关注 0票数 0

目前,我有app/styles/main.scss,我的sass被分解成多个结构化文件并导入到main.scss中。在我的index.html中,我有以下内容:

代码语言:javascript
复制
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->

我正在使用我在Gruntfile.js中看到的grunt-contrib sass指南针,现在我想另外编译一个文件,即app/styles/modules/_infowindow.scss

我尝试过以下几种方法:

代码语言:javascript
复制
sass: {
  dist: {
    files: [{
      expand: true,
      cwd: '<%= yeoman.app %>/styles/modules',
      src: ['_infowindow.scss'],
      dest: '.tmp/cdn/'
    }]
  }
},

终端输出如下:

代码语言:javascript
复制
Running "sass:dist" (sass) task
Verifying property sass.dist exists in config...OK
Files: app/styles/modules/_infowindow.scss -> .tmp/cdn/_infowindow.css
Options: (none)

但是当我检查.tmp的目录时,没有cdn的目录。

其他:

这是我当前的指南针设置;

代码语言:javascript
复制
// Compiles Sass to CSS and generates necessary files if requested
compass: {
  options: {
    sassDir: '<%= yeoman.app %>/styles',
    cssDir: '.tmp/styles',
    generatedImagesDir: '.tmp/images/generated',
    imagesDir: '<%= yeoman.app %>/images',
    javascriptsDir: '<%= yeoman.app %>/scripts',
    fontsDir: '<%= yeoman.app %>/fonts',
    importPath: './bower_components',
    httpImagesPath: '/images',
    httpGeneratedImagesPath: '/images/generated',
    httpFontsPath: '/fonts',
    relativeAssets: false,
    assetCacheBuster: false,
    raw: 'Sass::Script::Number.precision = 10\n'
  },
  dist: {
    options: {
      generatedImagesDir: '<%= yeoman.dist %>/images/generated'
    }
  },
  server: {
    options: {
      sourcemap: true
    }
  }
}
EN

回答

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

https://stackoverflow.com/questions/41352431

复制
相关文章

相似问题

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