A simple HTML + CSS + JS baseline with Gulp build tools.
project.test
.npm install
.gulp watch
.Prototypes are built using PHP includes for simple templating. The output is logic-less plain HTML, which is easily adaptable to test patterns and content together.
See: http://project.test/
Frontend code follow the GravDept code standards, which are maintained here:
Gulp powers the frontend build system. All the frontend assets (CSS, JS, images) are processed from source material into production-ready assets.
File | Description |
---|---|
.eslintrc | Configuration for JS linting. Avoid editing. |
gulp/config.js | Configuration for all Gulp tasks. Edit this frequently. |
gulp/error-handler.js | Show readable error message in the console from failed Gulp tasks. Avoid editing. |
node-modules/ | Contains Node modules installed via NPM. Never edit. |
gulpfile.js | Define Gulp tasks. Add tasks as needed. Avoid rewriting tasks. |
package.json | Define Node modules the build process requires. Maintain this monthly. |
package-lock.json | Lock file for Node module dependencies. Never edit. |
stylelint.config.js | Configuration for CSS linting. Avoid editing. |
Task Name | Description | |
---|---|---|
clean | Delete all assets generated by the build. This runs before "default" task to force all site assets to be generated. |
|
css | Pre-process SCSS to CSS. Process SCSS to sourcemaps. Post-process CSS with Autoprefixer. |
|
default | Run "clean" to force all site assets to be regenerated. Run all specified tasks and linters (css, image, js). |
|
image | Optimize image files (JPG, PNG, GIF, SVG) using ImageOptim library. | |
js{BundleName} | Compress JS without mangling (rewriting for shortness). Concatenate into bundles. Process JS to sourcemaps. |
|
lintCss | Lint CSS with "stylelint" module. This runs in "default" and anytime a watched CSS file is changed. |
|
lintJs | Lint JS with "ESLint" module. This runs in "default" and anytime a watched JS file is |
changed. |
watch | Run "default" immediately. Start watchers for appropriate tasks. |
cd /your/project/path
npm install
Command | Description |
---|---|
gulp |
Run "default" task (once) |
gulp watch |
Run "default" task and continue watching |
gulp {taskName} |
Run a specific task |
gulp --hide-notify |
Run "default" task (once) and suppress Mac/Windows notifications |
gulp --show-properties |
Run "default" task (once) and log detailed error info in the console |
npm outdated
npm update
gulp
Sometimes updating fails or breaks the build. Before reverting to prior versions try:
/node-modules
folder.npm install
.npm update
.gulp
.Sometimes updating fails or breaks the build. Before reverting to prior versions try:
/node-modules
folder.npm install
.