Preparing to Publish Your Library


placeholder

This is a premium lesson.

Subscribe to get access to the entire course.

Sign up now

Now that you’ve created and styled your very first component, you’re going to learn how to publish for others across the world to use.

The checkbox in its current state isn’t fit for publishing though, there are a few bits of housekeeping we need to get in order first.

What we’ll do in this lesson is refactor the structure of the repo to separate the component from the current HTML page.

Currently, the component is defined and consumed in the same HTML file. Since HTML imports don’t exist, we can’t publish our component like this. So the first thing we need to do is to move the component out into its file.

Secondly, we’ll want to organise the structure of our repo so each export is contained within its own directory.

By the end of this lesson, your repo will have the following structure:

component-odyssey/
index.html
package.json
src/
checkbox/
checkbox.js
shared/
base-styles.js
styles
styles.css

Before moving on, it’s best that you start the development server an