diff --git a/.gitignore b/.gitignore index 3fe3af4b4..31f0ca954 100755 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node/server.json test/coverage/ coverage/ semantic.config +semanticui/ # Numerous always-ignore extensions *.diff diff --git a/Gruntfile.js b/Gruntfile.js index 2b68bce63..94e501398 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -82,6 +82,12 @@ module.exports = function(grunt) { // creates custom license in header 'cssmin:createMinCSSPackage', + // create npm package + 'copy:npm', + + // replace $.fn.xyz with module.exports and require('jquery') + 'replace:npm', + // cleans previous generated release 'clean:release' @@ -428,6 +434,24 @@ module.exports = function(grunt) { ] }, + + npm: { + files: [ + { + expand : true, + cwd : 'build/uncompressed', + src : [ + '**/*' + ], + dest: 'npm' + }, + { + src: 'package.json', + dest: 'npm/package.json' + } + ] + }, + // create new rtl assets buildToRTL: { files: [ @@ -565,6 +589,31 @@ module.exports = function(grunt) { } }, + replace: { + npm: { + options: { + patterns: [ + { + match: /\$.fn.\w+/g, + replacement: 'module.exports' + }, + { + match: /jQuery/g, + replacement: 'require("jquery")' + } + ] + }, + files: [ + { + expand : true, + src : '**/*.js', + cwd : 'build/uncompressed', + dest : 'npm' + } + ] + } + }, + uglify: { minifyJS: { @@ -631,6 +680,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch');