create-package
The
create-package
command creates a new Frontity package in a project. Launch this command from the root of the Frontity projectnpx frontity create-package [package-name] [options]
This argument sets the name of your Frontity package. The
create-package
command will create a folder named [package-name]
under packages
. It will also add the proper dependency in the package.json
of your Frontity projectOption | Description |
--namespace <value> | |
--no-prompt | |
--open | Output usage information |
- Create a custom theme package named
my-custom-project
> npx frontity create-package my-custom-theme
? Enter the namespace of the package: theme
✔ Adding package.json.
✔ Adding src/index.js.
✔ Installing package my-custom-theme.
New package "my-custom-theme" created.
If you pass the
--no-prompt
flag to the create-package
, the CLI will use the name from this FRONTITY_CREATE_PACKAGE_NAME
environment variable.If the CLI cannot find a
FRONTITY_CREATE_PACKAGE_NAME
environmental variable, it will prompt for the name of the packageExample:
FRONTITY_CREATE_NAME=test-project
You can see a scheme of the whole workflow of using this
FRONTITY_CREATE_PACKAGE_NAME
environment variable in the --no-prompt
sectionLast modified 2yr ago