Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 41123b8

Browse files
committed
chore(grunt): use surround
Following #134 and #133 Auto surround the sources
1 parent e0adcf6 commit 41123b8

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.jshintrc

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"browser": true,
44
"eqnull": true,
55
"expr": true,
6-
"globalstrict": true,
76
"immed": true,
87
"indent": 2,
98
"laxbreak": true,

demo/demo.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
'use strict';
21

32
var myapp = angular.module('sortableApp', ['ui.sortable']);
43

54
myapp.controller('sortableController', function ($scope) {
5+
'use strict';
6+
67
var tmpList = [];
78

89
for (var i = 1; i <= 6; i++){

gruntFile.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function(grunt) {
77
// Default task.
88
grunt.registerTask('default', ['jshint', 'karma:unit']);
99
grunt.registerTask('serve', ['karma:continuous', 'dist', 'build:gh-pages', 'connect:continuous', 'watch']);
10-
grunt.registerTask('dist', ['ngmin', 'uglify']);
10+
grunt.registerTask('dist', ['ngmin', 'surround', 'uglify' ]);
1111
grunt.registerTask('coverage', ['jshint', 'karma:coverage']);
1212

1313

@@ -91,16 +91,28 @@ module.exports = function(grunt) {
9191
},
9292

9393
uglify: {
94-
options: {banner: '<%= meta.banner %>'},
9594
build: {
9695
expand: true,
9796
cwd: 'dist',
98-
src: ['*.js'],
97+
src: ['*.js', '!*.min.js'],
9998
ext: '.min.js',
10099
dest: 'dist'
101100
}
102101
},
103102

103+
surround: {
104+
options: {
105+
prepend: '(function(window, angular, undefined) { \'use strict\';',
106+
append: '})(window, window.angular);'
107+
},
108+
main: {
109+
expand: true,
110+
cwd: 'src',
111+
src: ['*.js'],
112+
dest: 'dist'
113+
}
114+
},
115+
104116
ngmin: {
105117
main: {
106118
expand: true,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"angular-ui-publisher": "1.2.x",
1212
"grunt": "~0.4.x",
1313
"grunt-contrib-connect": "0.5.x",
14+
"grunt-surround": "0.1.x",
1415
"grunt-contrib-jshint": "0.8.x",
1516
"grunt-contrib-uglify": "0.2.x",
1617
"grunt-contrib-watch": "0.5.x",

0 commit comments

Comments
 (0)