- Howtos
- Common code challenges
- Part dependencies
Part dependencies
Part dependencies control the order in which parts are drafted. FreeSewing will make sure to draft all of a part’s dependencies before drafting the part itself.
WARNING|
Even though inherited parts are automatically included in a part’s dependencies, do not confuse part dependencies with part inheritance.
Part dependencies are configured with the after
keyword. Let’s look at an
example:
Javascript
import { otherPart } from './otherpart.mjs'
export const myPart = {
name: 'example.myPart',
after: otherPart,
draft: function ({ part }
) {
// Design part here
return part
}
}
TIP
Refer to the part documentation on dependencies for all details.