-
Notifications
You must be signed in to change notification settings - Fork 2
Quickstart Tutorial
Wilson FT edited this page Sep 1, 2017
·
10 revisions
You need to install globally kobol
npm install kebot -gThen at the root of your project you need to install it locally
npm install kebot --save-devCreate your kebotfile
var kebot = require("kebot");
kebot.task({
alias:'css',
entry:'./tasks/css.js'
});Prepare your script
// css.js
var fs = require('fs');
var postcss = require('postcss');
var autoprefixer = require('autoprefixer');
fs.readFile('src/index.css', function(err, css){
postcss([autoprefixer])
.process(css, { from: 'src/index.css', to: 'public/index.css' })
.then(function(result){
fs.writeFile('public/index.css', result.css);
if(result.map){
fs.writeFile('public/index.css.map', result.map);
};
});
});Then run and see the magic
kb css