https://github.com/unclechu/web-front-end-grunt-template
Template for new front-end projects.
https://github.com/unclechu/web-front-end-grunt-template
Last synced: 8 months ago
JSON representation
Template for new front-end projects.
- Host: GitHub
- URL: https://github.com/unclechu/web-front-end-grunt-template
- Owner: unclechu
- License: gpl-3.0
- Created: 2014-03-27T07:27:02.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-15T02:09:31.000Z (over 11 years ago)
- Last Synced: 2024-12-27T22:20:53.090Z (over 1 year ago)
- Language: CSS
- Homepage:
- Size: 709 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Web front-end template based on grunt
=====================================
Template for new front-end projects.
Usage
=====
Deployment
----------
```bash
$ ./deploy.sh
```
Put your deploy tasks to [_deploy](./_deploy/) directory.
Configutaion
------------
See for key "grunt" in [package.json](./package.json)
```json
"grunt": {
"styles": [
{
"path": "styles",
"files": { "build.css": "main.less" }
}
],
"scripts": [
{
"path": "scripts",
"buildFile": "build.js",
"notAmdFiles": [ "*require*.js" ],
"amd": true
}
],
"jshint": {
"development": true,
"production": true
},
"sprites": {
"icons": {
"src": [ "icons/*" ],
"css": "styles/src/icons/icons.less",
"sprite": "images/icons_sprite.png"
}
}
}
```
"amd" flag for AMD style of js-modules ([RequireJS](http://requirejs.org/))
Commands
--------
Build all (styles and scripts) for production:
```bash
$ ./grunt
```
Or:
```bash
$ ./grunt production
```
Development build (styles and scripts):
```bash
$ ./grunt build
```
Or:
```bash
$ ./grunt development
```
Development build (only styles):
```bash
$ ./grunt build-less
```
Development build (only scripts):
```bash
$ ./grunt build-js
```
Generating sprites
```bash
$ ./grunt gen-sprites
```
Cleanup all builded files:
```bash
$ ./grunt clean
```
Cleanup only styles builds:
```bash
$ ./grunt clean-less
```
Cleanup only scripts builds:
```bash
$ ./grunt clean-js
```
Cleanup sprites:
```bash
$ ./grunt clean-sprites
```
Cleanup initialization:
```bash
$ ./grunt distclean
```
Watch for any changes (in styles and in scripts) and rebuilding:
```bash
$ ./grunt watcher
```
Watch for changes in styles only and rebuilding:
```bash
$ ./grunt watcher-less
```
Watch for changes in scripts only and rebuilding:
```bash
$ ./grunt watcher-js
```
Preprocessing
-------------
Create file `preprocess_context.json` in scripts sources directory with context to preprocessing. See for details: https://github.com/jsoverson/grunt-preprocess
Scripts load order
------------------
1. libs
2. src
If you need to specific load order, just name your scripts with number prefixes:
1. libs/10-jquery.js
2. libs/20-jquery.mousewheel.plugin.js
3. src/10-main.js
4. src/20-header.js
5. src/30-forms.js
For AMD style you need only require.js at first:
1. libs/10-require.js
2. libs/jquery.js
3. libs/jquery.mousewheel.plugin.js
4. src/main.js
5. src/header.js
6. src/forms.js
Issues
======
https://github.com/unclechu/grunt-project-templates/issues
Author
======
Viacheslav Lotsmanov
License
=======
[GNU/GPLv3](./LICENSE)