Created
April 18, 2014 18:48
-
-
Save Opus1no2/11058821 to your computer and use it in GitHub Desktop.
foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| var srcFiles = [ | |
| 'src/intro.js', | |
| 'src/utilities.js', | |
| 'src/utilities/tunnel.js', | |
| 'src/utilities/sha1.js', | |
| 'src/utilities/abandonment.js', | |
| 'src/utilities/thirdPartyCookies.js', | |
| 'src/cookie.js', | |
| 'src/ocode/ocode.js', | |
| 'src/ocode/popup.js', | |
| 'src/ocode/events.js', | |
| 'src/ocode/floating.js', | |
| 'src/ocode/bar.js', | |
| 'src/ocode/tab.js', | |
| 'src/ocode/onPageCardjs', | |
| 'src/invitation.js', | |
| 'src/outro.js' | |
| ]; | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| "string-replace": { | |
| my_target: { | |
| files: { | |
| 'dist/<%= pkg.name %>.js': 'dist/<%= pkg.name %>.js' | |
| }, | |
| options: { | |
| replacements: [{ | |
| pattern: /\{\{umd\}\}/g, | |
| replacement: "enabled" | |
| }] | |
| } | |
| } | |
| }, | |
| concat: { | |
| options: { | |
| separator: '\n' | |
| }, | |
| dist: { | |
| src: srcFiles, | |
| dest: 'dist/<%= pkg.name %>.js' | |
| } | |
| }, | |
| uglify: { | |
| options: { | |
| banner: '/*! <%= pkg.name %>' | |
| + '<%= grunt.template.today("dd-mm-yyyy") %> */' | |
| }, | |
| dist: { | |
| files: { | |
| 'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] | |
| } | |
| } | |
| }, | |
| jshint: { | |
| files: ['Gruntfile.js', 'src/**/*.js'], | |
| options: { | |
| // options here to override JSHint defaults | |
| globals: { | |
| jQuery: true, | |
| console: true, | |
| module: true, | |
| document: true | |
| } | |
| } | |
| }, | |
| watch: { | |
| files: ['<%= jshint.files %>'], | |
| tasks: ['jshint'] | |
| }, | |
| sass: { | |
| dist: { | |
| options: { | |
| style: 'expanded' | |
| }, | |
| files: { | |
| 'dist/oo_style.css': 'stylesheets/oo_style.scss' | |
| } | |
| } | |
| }, | |
| cssmin: { | |
| options: { | |
| banner: '/* My minified css file */' | |
| }, | |
| combine: { | |
| files: { | |
| 'dist/oo_style.min.css' : ['dist/oo_style.css'] | |
| } | |
| } | |
| }, | |
| qunit: { | |
| all: ['test/index.html'] | |
| } | |
| }); | |
| grunt.loadNpmTasks('grunt-contrib-qunit'); | |
| grunt.loadNpmTasks('grunt-contrib-connect'); | |
| grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
| grunt.loadNpmTasks('grunt-contrib-sass'); | |
| grunt.loadNpmTasks('grunt-string-replace'); | |
| grunt.loadNpmTasks('grunt-contrib-uglify'); | |
| grunt.loadNpmTasks('grunt-contrib-jshint'); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); | |
| grunt.loadNpmTasks('grunt-contrib-concat'); | |
| grunt.registerTask('umd', ['concat', 'string-replace', 'uglify']); | |
| grunt.registerTask('test', ['qunit']); | |
| grunt.registerTask('lint', ['jshint']); | |
| grunt.registerTask('build', ['concat', 'sass', 'uglify', 'cssmin']); | |
| grunt.registerTask('css', ['sass']); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment