-
Notifications
You must be signed in to change notification settings - Fork 5
Npm scripts
We decided to use npm as our task runner. Why? Because it's easy to set up, fast and realiable. We're using some really simples tasks like compile Sass and uglify JavaScript, and we already uses npm to install some modules like Bootstrap, so, why not use just it?
But you're not obligated to use npm scripts, feel free to use nothing or a task runner of your preference.
The modules that are used are defined into package.json
, to install the packages, open your terminal, go to the theme directory and type: npm install
. That command will create a directory called node_modules
and will store all the modules here.
You must install globally the npm package gnomon, used to measure the time spent on each task. Type npm install -g gnomon
to install it. Once the modules are installed, you can use the npm scripts define in package.json
.
See the list of available commands.
Use npm run sass
to compile all the .scss in /src/scss
to .css into /assets/css
Use npm run uglify
to combine and minify JavaScript from /src/js
to /assets/js
Use npm run lint
to run eslint to check all .js in /src/js
. ESlint configs are defined in .eslintrc.json
. See https://eslint.org/ to know more.
Use npm run watch
to let the scripts constantly looking for changes in js/css and running Sass compiling and JavaScript lint and uglify.

Getting Started:
Templates:
Automating Tasks:
Styles:
Scripts:
Others:
Classes:

Documentação:
Iniciando:
Templates:
Automatizando tarefas:
Estilos:
Scripts:
Outros:
Classes: