瀏覽代碼

chore: add grunt task to add newline to end of built files

Closes #202
Estevão Soares dos Santos 9 年之前
父節點
當前提交
e928622664
共有 5 個文件被更改,包括 17 次插入6 次删除
  1. 12 3
      Gruntfile.js
  2. 3 2
      dist/showdown.js
  3. 0 0
      dist/showdown.js.map
  4. 1 1
      dist/showdown.min.js
  5. 1 0
      package.json

+ 12 - 3
Gruntfile.js

@@ -16,7 +16,7 @@ module.exports = function (grunt) {
       options: {
         sourceMap: true,
         banner: ';/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n(function(){\n',
-        footer: '}).call(this);'
+        footer: '}).call(this);\n'
       },
       dist: {
         src: [
@@ -52,6 +52,15 @@ module.exports = function (grunt) {
       }
     },
 
+    endline: {
+      dist: {
+        files: {
+          'dist/<%= pkg.name %>.js': 'dist/<%= pkg.name %>.js',
+          'dist/<%= pkg.name %>.min.js': 'dist/<%= pkg.name %>.min.js'
+        }
+      }
+    },
+
     jshint: {
       options: {
         jshintrc: '.jshintrc'
@@ -97,7 +106,7 @@ module.exports = function (grunt) {
           changelogOpts: {
             preset: 'angular'
           }
-        },
+        }
       }
     },
 
@@ -180,7 +189,7 @@ module.exports = function (grunt) {
 
   grunt.registerTask('lint', ['jshint', 'jscs']);
   grunt.registerTask('test', ['clean', 'lint', 'concat:test', 'simplemocha:node', 'clean']);
-  grunt.registerTask('build', ['test', 'concat:dist', 'uglify']);
+  grunt.registerTask('build', ['test', 'concat:dist', 'uglify', 'endline']);
   grunt.registerTask('prep-release', ['build', 'conventionalChangelog']);
 
   // Default task(s).

+ 3 - 2
dist/showdown.js

@@ -1,4 +1,4 @@
-;/*! showdown 07-10-2015 */
+;/*! showdown 14-10-2015 */
 (function(){
 /**
  * Created by Tivie on 13-07-2015.
@@ -2292,4 +2292,5 @@ if (typeof module !== 'undefined' && module.exports) {
   root.showdown = showdown;
 }
 }).call(this);
-//# sourceMappingURL=showdown.js.map
+
+//# sourceMappingURL=showdown.js.map

文件差異過大導致無法顯示
+ 0 - 0
dist/showdown.js.map


文件差異過大導致無法顯示
+ 1 - 1
dist/showdown.min.js


+ 1 - 0
package.json

@@ -47,6 +47,7 @@
     "grunt-contrib-uglify": "^0.6.0",
     "grunt-conventional-changelog": "^4.0.0",
     "grunt-conventional-github-releaser": "^0.3.0",
+    "grunt-endline": "^0.4.0",
     "grunt-jscs": "^1.2.0",
     "grunt-simple-mocha": "^0.4.0",
     "js-beautify": "^1.5.6",

部分文件因文件數量過多而無法顯示