[英]Grunt Sass to CSS not building
目前,我有app/styles/main.scss
,我的sass被分解為多個結構化文件,並導入到main.scss
。 在我的index.html
我具有以下內容:
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
我正在使用Gruntfile.js中看到的grunt-contrib-sass指南針,現在我想另外編譯一個文件,即app/styles/modules/_infowindow.scss
我嘗試了以下方法:
sass: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/styles/modules',
src: ['_infowindow.scss'],
dest: '.tmp/cdn/'
}]
}
},
終端輸出以下內容:
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
目錄。
額外:
這是我當前的指南針設置;
// 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
}
}
}
您應該重命名該文件,以便它不再使用下划線,因此不再是下划線,並在grunt任務中使用不帶下划線的新名稱。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.