Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 06b0ed3

Browse files
committed
feat(minification): add support for minification using r.js
Add ngr.js a wrapper around r.js that expands ngDefines statements to raw RequireJS / AngularJS modules. - script can be invoked from web (see `test/ngr/optimize.html`) or node Closes #2
1 parent dabacfe commit 06b0ed3

File tree

19 files changed

+26761
-67
lines changed

19 files changed

+26761
-67
lines changed

CHANGELOG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 1.1
2+
3+
- update module load error messages
4+
- add ability to minify ngDefine scripts using ngr.js
5+
6+
ngr.js works as a wrapper around r.js (the requirejs optimizer).
7+
It expands scripts that contain ngDefine to plain RequireJS / angular modules.
8+
9+
# 1.0.0
10+
11+
- initial release

Gruntfile.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
module.exports = function(grunt) {
22

3-
// Project configuration.
3+
// project configuration
44
grunt.initConfig({
55
pkg: grunt.file.readJSON('package.json'),
6-
uglify: {
7-
options: {
8-
banner: '/** ngDefine v1.0.0 | (c) Nico Rehwaldt <http://github.com/Nikku>, 2013 | license: MIT */\n'
9-
},
10-
build: {
11-
src: 'src/ngDefine.js',
12-
dest: 'build/ngDefine.min.js'
6+
requirejs: {
7+
compile: {
8+
options: {
9+
name : 'ngDefine',
10+
baseUrl: './src',
11+
paths: {
12+
'angular': 'empty:'
13+
},
14+
out: 'build/ngDefine.min.js'
15+
}
1316
}
1417
}
1518
});
1619

17-
// Load the plugin that provides the "uglify" task.
18-
grunt.loadNpmTasks('grunt-contrib-uglify');
19-
20-
// Default task(s).
21-
grunt.registerTask('default', ['uglify']);
20+
grunt.loadNpmTasks('grunt-contrib-requirejs');
2221

22+
grunt.registerTask( 'default', [ 'requirejs' ]);
2323
};

0 commit comments

Comments
 (0)