Skip to content

05. Configuration

Vlado Bosnjak edited this page Jul 16, 2023 · 5 revisions

Environment variables are saved in .env.local during setup.

Adding entry points

Entry points are save in src/entry. Js/CSS filename is generated based on folder/filename.[ext] structure

Example

Duplicate folder src/entry/common and rename folder to eg pages This will generate:

/dist/css/pages-common.css
/dist/js/pages-common.js

You rename pages/common.js to pages/cutom-page-template.js This will generate:

/dist/css/pages-cutom-page-template.css
/dist/js/pages-cutom-page-template.js

This would allow you to dynamically enqueue file based on specific page template. You can generate as many as you like, based on your needs.


Build commands

  • yarn dev — Start your development process, this will compile and live reload your browser or inject css when possible while in development
  • yarn build — Compile and optimize the files
  • yarn build:prod — Compile and optimize for production

Additional commands

  • yarn clean — Remove your dist folder
  • yarn reinit — Remove your dist and node_modules folder and reinstall node dependencies
  • yarn lint — Run ESLint/Stylelint against your source files and build scripts
  • yarn lint:scripts — Run ESLint against your source files and build scripts
  • yarn lint:styles — Run Stylelint against your source files
Clone this wiki locally