【发布时间】:2013-09-20 07:44:07
【问题描述】:
我的Gruntfile.js 包含 Compass 的任务:
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// FILE PATHS (custom)
dir: {
css: 'resources/styles/css',
fonts: 'resources/fonts',
html: 'resources/html',
images: 'resources/images',
includes: 'resources/includes',
node_modules: 'node_modules',
prototypes: 'resources/html/prototypes',
resources: 'resources',
scripts: 'resources/scripts',
scss: 'resources/styles/scss',
styles: 'resources/styles',
styleguide: 'resources/styleguide',
vendor: 'resources/vendor',
user: {
htdocs: '/Volumes/VR\ Mini\ Backup/Backups/Web/Active/myproject/htdocs'
}
},
// COMPASS
compass: {
dist: {
options: {
...
importPath: [
'<%= dir.user.htdocs %>/<%= dir.resources %>/vendor',
'<%= dir.user.htdocs %>/<%= dir.resources %>/fonts'
]
指南针options 之一是importPath。这需要一个绝对/系统路径。 importPath 的一个示例是 /system/path/to/htdocs/resources/vendor。
由于多个开发人员将参与我的项目,我想让/system/path/to/htdocs 动态化。
有没有办法从这个文件中访问Gruntfile.js 的路径?
谢谢。
【问题讨论】:
标签: compass-sass gruntjs