2

The angular generator has a dependency on compass and thus ruby when using SASS.

Two questions:

  1. Is it possible/practical to remove the ruby dependency by using something like node-sass?
  2. If so, how do I accomplish #1 and still use angular generator to generate controllers, routes, services, etc in the future?
4

1 回答 1

1

If you are using the Yeoman Angular generator and you wish to use SASS/SCSS without depending on Ruby, you could use the grunt-sass Grunt module.

Yeoman is essentially a project set-up with Grunt so you can just add whichever Grunt modules you need. If you are unfamiliar with Grunt, you can read the documentation here.

Essentially, you can set up the Grunt configuration for your SASS task, then register the task in your generated project's Gruntfile.js:

grunt.initConfig({
    sass: {
        options: {
            sourceMap: true
        },
        dist: {
            files: {
                'main.css': 'main.scss'
            }
        }
    }
});

grunt.registerTask('default', ['sass']);

You should note that this Grunt module uses Node SASS for CSS compilation instead of Compass, so you may be missing out on some Compass mixins you may be used to.

于 2015-06-08T17:55:51.427 回答