Npm commands (scripts)
Npm scripts help with performing repetitive tasks like minification, compilation, unit testing, linting, etc. The Silicon build system consists of a variety of JavaScript files, each performing specific tasks, and associated Npm scripts that execute these files.
The list of available Npm commands (scripts)
Command | Description |
---|---|
bun i or yarn or npm install |
This command is used to install Node.js packages and their dependencies in a project. The dependencies are listed in a "package.json" file in the project's root directory, under the "dependencies" and "devDependencies" sections. |
bun dev or yarn dev or npm run dev |
Builds and minifies styles and scripts, initiates a watch process to detect files changes. This is the primary command to utilize when customizing the template. |
bun run build or yarn build or npm run build |
Builds both expanded and minified versions of styles and scripts. |
To spin up the Django development server, follow the below-mentioned steps in a separate terminal:
Command | Description |
---|---|
python3 -m venv environment_name | Create Virtual Environment on Linux & macOS |
python -m venv environment_name | Create Virtual Environment on Windows OS |
source environment_name/bin/activate | Activate Environment on Linux & macOS |
environment_name/Scripts/activate | Activate Environment on Windows OS |
pip install -r requirements/local.txt | This would install all the required python dependencies. |
python3 manage.py migrate | Run the migration to sync the database on Linux & macOS |
python manage.py migrate | Run the migration to sync the database on Windows OS |
python3 manage.py runserver | Starts the local server on localhost:8000 on Linux & macOS |
python manage.py runserver | Starts the local server on localhost:8000 on Windows OS |
Note:
-
During Development, keep the development server running through any of the
above
dev
commands and then run the python'srunserver
command in a separate terminal. -
For Production, create a production build with any of the above
build
commands and then run the python'srunserver
command.