This project automates and optimizes various development tasks using Gulp.js. The tasks include compiling SASS to CSS, transpiling and minifying JavaScript, optimizing images, generating spritesheets, compiling templates, and more.
- Node.js (v18.x or later)
- npm (v6.x or later) or yarn (v1.x or later)
- Clone the repository:
git clone https://github.com/mavisland/starter.git
cd starter
- Install the dependencies:
npm install
# or
yarn install
The configuration file starter.config.mjs
holds paths and settings for different tasks. Ensure this file is correctly set up according to your project structure.
Archives pre-existing content from output folders into a ZIP file with a timestamp.
Removes pre-existing content from the output folders.
Generates a spritesheet and corresponding SASS variables from a set of images.
Copies static files such as fonts and scripts to the output directory.
Performs a full build of the project, including:
- Copying static files
- Compiling and minifying scripts
- Compiling, autoprefixing, and minifying styles
- Compiling templates
- Optimizing images
Watches for changes in source files and automatically triggers the appropriate tasks.
Runs the default task, which builds the project, starts a development server, and watches for changes.
- Start the development server and watch for changes:
gulp
- The development server runs at
http://localhost:9050
. Any changes made to the source files will automatically trigger the relevant tasks and reload the browser.
- Compiles SASS to CSS
- Autoprefixes CSS for cross-browser compatibility
- Minifies the CSS
- Transpiles JavaScript using Babel
- Concatenates and minifies JavaScript files
- Compiles Twig templates to HTML
- Uses JSON data to populate templates
- Optimizes GIF, JPEG, PNG, and SVG images
- Generates a spritesheet and corresponding SASS variables from a set of images
- Copies fonts and additional scripts to the output directory
Each generated file includes a banner with the following information:
- Project name
- Project description
- Version
- Homepage
- License
This project is licensed under the MIT License. See the LICENSE file for details.