Skip to content

a basic web/dev environment built using Node.js & Gulp

License

Notifications You must be signed in to change notification settings

robertsaupe/node-webdev-basic

Repository files navigation

node-webdev-basic - basic web/dev environment

Supporting | Features | License | Installing | Getting started | Updating

Supporting

GitHub | Patreon | PayPal | Amazon

Features

  • build web projects with live develop
    • copy files
    • ejs -> minify html
    • sass/scss -> minify css
    • minify js
    • optimize/minify images (png,svg,gif,jpg,jpeg)
    • favicon.png -> favicon.ico

License

This software is distributed under the MIT license. Please read LICENSE for information.

Installing

Requirements

Installing Requirements on Windows

First, ensure that you are using an administrative shell - you can also install as a non-admin, check out Non-Administrative Installation.

Install with powershell.exe

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Other install methods can be found here.

choco install imagemagick
choco install graphicsmagick
choco install nvm

Installing Node.js Version using NVM for Windows

$nvmrc = Get-Content .nvmrc
Invoke-Expression -Command "nvm install $nvmrc"
Invoke-Expression -Command "nvm use $nvmrc"

PowerShell Startup Script for .nvmrc

Create a profile file
New-item –type file –force $profile
edit the created profile file and add
Function runNvmUse([string]$version) {
    Invoke-Expression -Command "nvm use $version"
}
if (Test-Path .nvmrc) {
    $nvmrc = Get-Content .nvmrc
    $project_version = "v$nvmrc"
    $current_version = Invoke-Expression -Command "node -v"
    if ($project_version -ne $current_version) {
        runNvmUse($nvmrc)
    } else {
        Write-Output "Already using node $current_version"
    }
}

Install Gulp

npm install -g gulp

Environment

git clone https://github.com/robertsaupe/node-webdev-basic.git
cd node-webdev-basic/
npm i

Getting started

live develop:

npm run dev_build

just build project:

npm run build

clear builds:

npm run clear

Updating

Updating Dependencies

npm install -g npm-check-updates
ncu -u
npm install