Tasks
Skier is built around a modular task pipeline. Each task performs one build step.
How It Works
- You define an array of tasks in your config file
- Skier runs each task sequentially
- Tasks share data via the global context
export default [
task1(), // Runs first
task2(), // Runs second, can access task1's output
task3(), // Runs third, can access both
];Task Types
| Type | Purpose | Examples |
|---|---|---|
| Built-in | Common static site needs | generatePagesTask, copyStaticTask |
| Custom | Your project-specific logic | Data processing, API fetching |
Global Context
Tasks communicate through a shared global object:
// Task 1 returns data
const task1 = {
name: 'collect-posts',
run: async (config, ctx) => {
return { posts: ['Post 1', 'Post 2'] }; // Merged into globals
}
};
// Task 2 reads that data
const task2 = {
name: 'use-posts',
run: async (config, ctx) => {
console.log(ctx.globals.posts); // ['Post 1', 'Post 2']
}
};Learn More
- Built-in Tasks — All built-in tasks with docs
- Custom Tasks — Write your own tasks
- Architecture — Deep dive into the pipeline