javascript - 如何在 yeoman Angular bootstrap-saas i 中从 main.scss 生成 css

标签 javascript twitter-bootstrap sass npm yeoman

我已经开始了一个项目:

$ yo angular
include Twitter Bootstrap? Yes
use the SCSS version of Twitter Bootstrap with the Compass CSS Authoring Framework? Yes
$ grunt watch

我更改了 app/stypes 目录中的 main.scss 文件,我在控制台中看到它发生了更改,但没有生成 CSS 文件。这是怎么回事?

当前的咕噜声说:

// Watches files for changes and runs tasks based on the changed files
watch: {
  bower: {
    files: ['bower.json'],
    tasks: ['wiredep']
  },
  js: {
    files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
    tasks: ['newer:jshint:all'],
    options: {
      livereload: '<%= connect.options.livereload %>'
    }
  },
  jsTest: {
    files: ['test/spec/{,*/}*.js'],
    tasks: ['newer:jshint:test', 'karma']
  },
  compass: {
    files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
    tasks: ['compass:server', 'autoprefixer']
  },
  gruntfile: {
    files: ['Gruntfile.js']
  },
  livereload: {
    options: {
      livereload: '<%= connect.options.livereload %>'
    },
    files: [
      '<%= yeoman.app %>/{,*/}*.html',
      '.tmp/styles/{,*/}*.css',
      '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
    ]
  }
},

最佳答案

这是 grunt 文档中有关编译样式表的内容。另请注意,转换发生在部署期间,而不是在监视下。

sass: {
    dist: {
      files: [{
        expand: true,
        cwd: 'styles',
        src: ['*.scss'],
        dest: '../public',
        ext: '.css'
      }]
    }
  }

关于javascript - 如何在 yeoman Angular bootstrap-saas i 中从 main.scss 生成 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31101170/

相关文章:

javascript - Mootools - Fx.Tween 与 Fx.Morph

javascript - node-fetch 接收空主体

html - 在 bootstrap3 中正确安装表格

css - 动画延迟属性在 Sass for 循环中不起作用

css - SASS - 访问多维数组的值

html - 如何将行高设置为字体大小加上整个元素的固定值

javascript - 选择框在应用 css/javascript 时失去功能

javascript - Capybara 无法识别动态添加的 DOM 元素?

css - Twitter-Bootstrap V4 导航栏下拉菜单缺少样式

javascript - 应用弹出消息框 OnClick