-
Notifications
You must be signed in to change notification settings - Fork 30
7. npm
There are a few Node dependencies for this project but they are completely optional to use in development. This is by design so you don't have to use npm
if you don't want to. You can find them within the theme's package.json
file.
-
postcss
/postcss-cli
- Required for PostCSS processing with Hugo. Setenable_postcss
totrue
in yourparams.toml
to enable PostCSS. If you don't havepostcss-cli
installed in development, make sure to setenable_postcss
tofalse
or you'll get an error. -
autoprefixer
- Part of the PostCSS setup inpostcss.config.js
.
It is recommended to install these dependencies locally in development with npm
. For production, Netlify will automatically install dependencies for you if you have a package.json
at the root of your repo.
First, copy the theme's package.json
file to the root of your project. Make sure you have npm
installed and are using the current LTS version. You can install/use nvm
to manage your version (e.g. nvm use 18
).
Then simply npm install
from your project's root directory. A package-lock.json
will be generated for you which you can commit to source control.
These available npm scripts all are defined in package.json
if you need to reference or customize them at any time.