npx frontity create
, we install three packages for you:@frontity/tiny-router
as an external package. It ends up in the node_modules
folder.@frontity/wp-source
as an external package. It ends up in the node_modules
folder.@frontity/mars-theme
as a local package. It ends up in the packages
folder.node_modules
to packages
it becomes a local package and you can change it at will. If you use git
, its code is also included in your project and you can commit any change. If you want to use that package in other projects or you want to contribute to the community, you can publish it to npm using npm publish
.node_modules
because that folder is not committed to git and it is thrown away each time you move, reinstall or deploy your project.package.json
. When they are local, they are referenced by folder and when they are external, by the version number:package.json
file. Its code is inside the /src
folder.package.json
file is where you can write the info (name, description, author, repository, version...) of the package. It's just a regular package.json
file, so nothing fancy here.dependencies
for the package. The "dependencies"
field gets automatically populated when you run npm install some-npm-package
in the package folder.package.json
file because:node_modules
./src/index.js
./src/client.js
and /src/server.js
./packages
folder of your Frontity project:my-theme
is available in npm! Any other Frontity user can install it using:frontity.settings.js
file:index.js
file:theme
or which one represents a source
. It treats all of them equally.