Próbuję automatycznie przesłać plik .css
, gdy jest skompilowany z Sass. To jest to, co mam w moim Gruntfile.js
:Grunt - obejrzyj plik i SFTP po zmianie
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
coffee: {
files: ['**/*.coffee'],
tasks: ['coffee']
},
scripts: {
files: ['**/*.scss'],
tasks: ['compass']
},
sftp: {
files: ['**/*.css'],
tasks: ['sftp-deploy']
}
},
coffee: {
compile: {
files: {
'testing.js': 'testing.coffee'
}
}
},
compass: {
dist: {
options: {
config: 'config.rb'
}
}
},
'sftp-deploy': {
build: {
auth: {
host: 'example.com',
port: 22,
authKey: 'key2'
},
src: 'styles/',
dest: 'styles/',
exclusions: ['**/.DS_Store'],
server_sep: '/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-sftp-deploy');
// Default task(s).
grunt.registerTask('default', ['watch']);
};
To kompiluje .css
ale nie wydaje się, aby go przesłać. Jakieś pomysły?
w jakim katalogu 'config.rb' wypisuje skompilowane' css' na? –
nie powinieneś robić tego lokalnie, a następnie podnosić tylko po uruchomieniu kroku kompilacji? –