You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-2
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
webapp-annotated-build-scaffolding
2
2
==================================
3
3
4
-
[Grunt](http://gruntjs.com/) scaffolding to build [LESS](http://lesscss.org/), [SASS](http://sass-lang.com/), [JavaScript source maps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/), [AMD](http://requirejs.org/docs/optimization.html) and [CommonJS](http://browserify.org/) for web apps based on annotated HTML. It is heavily inspired by [Yoeman](http://yeoman.io/)'s [generator-webapp](https://github.com/yeoman/generator-webapp). I really liked the concept of [grunt-usemin](https://github.com/yeoman/grunt-usemin), but I'm extremely obsessed with the exact things that I want. So I started building a scaffolding for myself.
4
+
[Grunt](http://gruntjs.com/) scaffolding to build [LESS](http://lesscss.org/), [SASS](http://sass-lang.com/), [JavaScript source maps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/), [AMD](http://requirejs.org/docs/optimization.html) and [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) for web apps based on annotated HTML. It is heavily inspired by [Yoeman](http://yeoman.io/)'s [generator-webapp](https://github.com/yeoman/generator-webapp). I really liked the concept of [grunt-usemin](https://github.com/yeoman/grunt-usemin), but I'm extremely obsessed with the exact things that I want. So I started building a scaffolding for myself.
5
5
6
6
The purpose behind this scaffolding is similar to [generator-webapp](https://github.com/yeoman/generator-webapp). That is you can write HTML files, which link raw JavaScript and CSS files for development. Then you can use [Grunt](http://gruntjs.com/) to process the same HTML files to generate and minify JavaScript and CSS files that are linked. Finally, new HTML files will be generated to link these minified JavaScript and CSS files.
7
7
@@ -17,7 +17,7 @@ Key Features
17
17
*[htmlrefs](https://github.com/tactivos/grunt-htmlrefs) is ran ahead of time, so you can perform even more magic.
18
18
* Build AMD modules and dependencies with [RequireJS Optimizer](http://requirejs.org/docs/optimization.html).
19
19
* Build CommonJS modules and dependencies with [Browserify](http://browserify.org/).
20
-
*[grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) integration such that CommonJS modules can be built whenever changes are saved. (Under development.)
20
+
*[grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) integration such that CommonJS modules can be built whenever changes are saved.
21
21
22
22
Samples
23
23
-------
@@ -133,6 +133,13 @@ Now you can build your project with: `grunt dev`, `grunt qa` and `grunt prd`. He
133
133
*`grunt qa` copies QA configs to `src` as well as `dist` direcotry. It then compiles, minifies and generates JavaScript, CSS and HTML with JavaScript source maps. Everything inside `dist` directory is ready for distribution. (You should be able to just ZIP up `dist` directory and send it to QA.)
134
134
*`grunt prd` copies production configs to `src` as well as `dist` direcotry. It is very similar to QA build, except it doesn't generate JavaScript source map. Again, `dist` directory is ready for distribution.
135
135
136
+
Due to the fact that [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) moduels need to be wrapped with [Browserify](http://browserify.org/) before running in a browser. There are tasks specially made for this.
137
+
138
+
*`devCommonJs` builds [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) modules with minimun amount of process. It does not perform any kind of minification or even full clean to keep things running as fast as possible. But we will have to run your app from `dist` directory instead.
139
+
*`watch:devCommonJs` uses [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) to watch changes you make. It will automatically run `devCommonJs` task whenever you save files. You should take a quick look at the `watch` task configs in `Gruntfile.js` to make sure that it ignored all the files you modify during build to avoid infinite build calls.
140
+
141
+
Additionally, there's a `watch:dev` task to watch for changes to config files then run `dev` task. This taks could come in handy when you are actively editing your config files, otherwise it's pretty useless.
142
+
136
143
Of course, there's `grunt clean` task to clean everything generated by [Grunt](http://gruntjs.com/).
0 commit comments