What is a 'Skill'?
- A 'skill' is an object that wrappers a tool such as Webpack, ESLint, Babel, and others
- It decides how the tool's configuration is changed so it can work with other tools
- Skills can be run by a subcommand they specify. For example, the
@alfred/skill-webpackskill is run with the
buildsubcommand it registers
- Alfred has default skills that can be overriden
To use a skill in your project, use the
alfred learn <skill-pkg-name> command, where
skill-pkg-name is the package name of the skill you want to install.
Here are a few examples of learning a skill:
Skills with Subcommands
Alfred comes with default skills. Below is a table of how these skills and which subcommands and targets they support.
Learning a skill can either replace or add subcommands to a project. For example, if you want to use webpack instead of parcel, you can run
alfred learn @alfred/skill-webpack. Since both webpack and parcel support the
start subcommands and parcel is a default skill, webpack will override parcel. Future calls to
alfred run build and
alfred run start will now use webpack instead of parcel.
Extending Skill Configs
Passing Command Line Flags to Skills
The following example passes flags to eslint. The example adds a custom formatter to eslint.