Learn how to use included npm scripts to compile source code, run local dev server, and more.
PROFI uses npm scripts for its build system. Our package.json includes convenient methods for working with the framework, including compiling code, running local development server and more.
To use our build system locally, you’ll need a copy of template’s source files and Node. Follow these steps and you should be ready to rock:
- Download and install Node.js, which we use to manage our dependencies.
- Unzip your theme and navigate to its root directory and run
npm installto install our local dependencies listed in
When completed, you’ll be able to run the various commands provided from the command line. It’s that simple! If you’re not used to using terminal, don’t worry, this is as advanced as it gets. If you want to kill the server and stop all tasks, just hit
Control + C.
Using npm scripts
package.json includes the following commands and tasks:
||Starts local development server with
||Compile & minify all your sources. Output of this command will be placed to the
npm run to see all the npm scripts.
Template sources are written with Twig template engine. You can find our its documentation on Twig’s official website.
PROFI uses Autoprefixer (included in our build process) to automatically add vendor prefixes to some CSS properties at build time. Doing so saves us time and code by allowing us to write key parts of our CSS a single time while eliminating the need for vendor mixins.
We maintain the list of browsers supported through Autoprefixer in a
package.json file within dedicated
Should you encounter problems with installing dependencies, uninstall all previous dependency versions (global and local). Then, rerun