This is TMing project's web frontend builder. The purpose is to automate repetitive tasks and make code update more agile.
Before you start, you need to install Node.js on your computer. Refer to the website for instructions:
'https://nodejs.org/'
When installed, clone this repository to you computer, navigate into its directory, and execute this command to install packages, and you are ready to start!
'npm i'
To develop using this builder, you need to do five things:
- Write html markup in handlebars syntax, and place the source file in /source/templates
- Write data for building HTML using Handlebars. This file is /source/data/data-structure.json
- Write Javascript and place files in /source/js, update gulpfile to include these JS files in specific loading order
- Write CSS and place files in /source/css, update gulpfile to include these CSS files in specific loading order
- Regarding images, copy those that you will be using in CSS file into /source/images; and those be used in HTML in /output/images.
In Terminal, navigate to this project folder, and execute this command to build files:
'npm run build'
If you wish to build non-compressed version for development debugging, use this command:
'npm run build-dev'
Once it's done, you should see the generated HTML in /output/index.html. Use the following command to start a simple Node.js server and verify this page:
'npm run start'
Use your browser to open this page:
'http://localhost:3000'
You may run this command to validate your Javascript file:
`npm run lint`
• Npm 'https://docs.npmjs.com/'
• Handlebars 'http://handlebarsjs.com/'
• Gulp 'http://gulpjs.com/'