2015-06-28 18 views
0

我已經開始與項目:如何從main.scss CSS在自耕農的角度引導的SaaS我

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

我改變main.scss文件中的應用程序/ stypes目錄,我把它改在控制檯中,但沒有生成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}' 
    ] 
    } 
}, 
+0

你是否配置了你的grunt來編譯你的** SCSS **? – Aravind

+0

我認爲咕嚕聲應該已經到位了,因爲yeoman? – Rolando

+0

你可以在這裏發佈你的配置嗎? – Aravind

回答

1

下面是繁重的文件說,有關編譯樣式表。還要注意的是,轉換髮生在部署過程中的地方,不是在手錶

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

如果它不在監視下,是否有辦法讓scss在您更改scss文件時編譯? – Rolando

+0

觀看scss文件沒有任何意義。該項目必須在編譯您的資產後進行部署。所以把它放在一些默認的任務運行下。 – Aravind

+0

我的項目是在Apache下,所以我可以隨時加載網址。這就是爲什麼我希望scss文件在我修改它時進行更改,以便可以隨時使用css輸出。 – Rolando