1- module . exports = function ( grunt ) {
2-
3- var pkg = grunt . file . readJSON ( 'package.json' ) ;
4-
5- var banner = [
6- '/**' ,
7- '* Ajax Autocomplete for jQuery, version ' + pkg . version ,
8- '* (c) 2017 Tomas Kirda' ,
9- '*' ,
10- '* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.' ,
11- '* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete' ,
12- '*/' ] . join ( '\n' ) + '\n' ;
13-
14- // Project configuration.
15- grunt . initConfig ( {
16- pkg : pkg ,
17- uglify : {
18- options : {
19- banner : banner
20- } ,
21- build : {
22- src : 'src/jquery.autocomplete.js' ,
23- dest : 'dist/jquery.autocomplete.min.js'
24- }
25- }
26- } ) ;
27-
28- // Load the plugin that provides the "uglify" task.
29- grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
30-
31- // Default task(s).
32- grunt . registerTask ( 'default' , [ 'uglify' ] ) ;
33-
34- grunt . task . registerTask ( 'build' , 'Create release' , function ( ) {
35- var version = pkg . version ,
36- src = grunt . file . read ( 'src/jquery.autocomplete.js' ) . replace ( '%version%' , version ) ,
37- filePath = 'dist/jquery.autocomplete.js' ;
38-
39- // Update not minimized release version:
40- console . log ( 'Updating: ' + filePath ) ;
41- grunt . file . write ( filePath , src ) ;
42-
43- // Minify latest version:
44- grunt . task . run ( 'uglify' ) ;
45-
46- // Update plugin version:
47- filePath = 'devbridge-autocomplete.jquery.json' ;
48- src = grunt . file . readJSON ( filePath ) ;
49-
50- if ( src . version !== version ) {
51- src . version = version ;
52- console . log ( 'Updating: ' + filePath ) ;
53- grunt . file . write ( filePath , JSON . stringify ( src , null , 4 ) ) ;
54- } else {
55- console . log ( 'No updates for: ' + filePath ) ;
56- }
57- } ) ;
58- } ;
1+ module . exports = function ( grunt ) {
2+ var pkg = grunt . file . readJSON ( "package.json" ) ;
3+
4+ var banner =
5+ [
6+ "/**" ,
7+ "* Ajax Autocomplete for jQuery, version " + pkg . version ,
8+ "* (c) 2025 Tomas Kirda" ,
9+ "*" ,
10+ "* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license." ,
11+ "* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete" ,
12+ "*/" ,
13+ ] . join ( "\n" ) + "\n" ;
14+
15+ // Project configuration.
16+ grunt . initConfig ( {
17+ pkg : pkg ,
18+ uglify : {
19+ options : { banner : banner } ,
20+ build : { src : "src/jquery.autocomplete.js" , dest : "dist/jquery.autocomplete.min.js" } ,
21+ } ,
22+ } ) ;
23+
24+ // Load the plugin that provides the "uglify" task.
25+ grunt . loadNpmTasks ( "grunt-contrib-uglify" ) ;
26+
27+ // Default task(s).
28+ grunt . registerTask ( "default" , [ "uglify" ] ) ;
29+
30+ grunt . task . registerTask ( "build" , "Create release" , function ( ) {
31+ var version = pkg . version ,
32+ src = grunt . file . read ( "src/jquery.autocomplete.js" ) . replace ( "%version%" , version ) ,
33+ filePath = "dist/jquery.autocomplete.js" ;
34+
35+ // Update not minimized release version:
36+ console . log ( "Updating: " + filePath ) ;
37+ grunt . file . write ( filePath , src ) ;
38+
39+ // Minify latest version:
40+ grunt . task . run ( "uglify" ) ;
41+
42+ // Update plugin version:
43+ filePath = "devbridge-autocomplete.jquery.json" ;
44+ src = grunt . file . readJSON ( filePath ) ;
45+
46+ if ( src . version !== version ) {
47+ src . version = version ;
48+ console . log ( "Updating: " + filePath ) ;
49+ grunt . file . write ( filePath , JSON . stringify ( src , null , 4 ) ) ;
50+ } else {
51+ console . log ( "No updates for: " + filePath ) ;
52+ }
53+ } ) ;
54+ } ;
0 commit comments