| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 17bbd1f commit 40580b7
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,51 +1,61 @@ | |||
| 1 | 1 | module.exports = function (grunt) { | |
| 2 | 2 | ||
| 3 | - "use strict"; | ||
| 3 | + 'use strict'; | ||
| 4 | 4 | ||
| 5 | 5 | // Project configuration. | |
| 6 | 6 | grunt.initConfig({ | |
| 7 | 7 | ||
| 8 | - pkg: grunt.file.readJSON("package.json"), | ||
| 8 | + pkg: grunt.file.readJSON('package.json'), | ||
| 9 | 9 | ||
| 10 | 10 | meta: { | |
| 11 | - banner: "/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n" | ||
| 11 | + banner: '/*!\n * <%= pkg.name %>\n * <%= pkg.description %>\n * @version <%= pkg.version %> - <%= grunt.template.today(\'yyyy-mm-dd\') %>\n * @author <%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n' | ||
| 12 | 12 | }, | |
| 13 | 13 | ||
| 14 | 14 | jshint: { | |
| 15 | 15 | all: { | |
| 16 | - src: ["src/*.js", "test/spec/*.js"], | ||
| 16 | + src: ['src/*.js', 'test/spec/*.js'], | ||
| 17 | 17 | options: { | |
| 18 | - jshintrc: ".jshintrc" | ||
| 18 | + jshintrc: '.jshintrc' | ||
| 19 | 19 | } | |
| 20 | 20 | } | |
| 21 | 21 | }, | |
| 22 | 22 | ||
| 23 | 23 | uglify: { | |
| 24 | 24 | dist: { | |
| 25 | - src: [ "<%= meta.banner %>", "src/paypal-button.js" ], | ||
| 26 | - dest: "dist/paypal-button.min.js", | ||
| 25 | + src: ['<%= meta.banner %>', 'src/paypal-button.js'], | ||
| 26 | + dest: 'dist/paypal-button.min.js', | ||
| 27 | 27 | options: { | |
| 28 | - banner: "<%= meta.banner %>" | ||
| 28 | + banner: '<%= meta.banner %>' | ||
| 29 | 29 | } | |
| 30 | 30 | } | |
| 31 | 31 | }, | |
| 32 | 32 | ||
| 33 | 33 | mochaTest: { | |
| 34 | 34 | all: { | |
| 35 | 35 | options: { | |
| 36 | - reporter: "spec" | ||
| 36 | + reporter: 'spec' | ||
| 37 | 37 | }, | |
| 38 | - src: ["test/spec/*.js"] | ||
| 38 | + src: ['test/spec/*.js'] | ||
| 39 | + } | ||
| 40 | + }, | ||
| 41 | + watch: { | ||
| 42 | + scripts: { | ||
| 43 | + files: ['src/**/*.js'], | ||
| 44 | + tasks: ['build'], | ||
| 45 | + options: { | ||
| 46 | + spawn: false | ||
| 47 | + } | ||
| 39 | 48 | } | |
| 40 | 49 | } | |
| 41 | 50 | }); | |
| 42 | 51 | ||
| 43 | 52 | // Load grunt tasks from npm packages | |
| 44 | - grunt.loadNpmTasks("grunt-contrib-jshint"); | ||
| 45 | - grunt.loadNpmTasks("grunt-contrib-uglify"); | ||
| 46 | - grunt.loadNpmTasks("grunt-mocha-test"); | ||
| 53 | + grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
| 54 | + grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
| 55 | + grunt.loadNpmTasks('grunt-contrib-watch'); | ||
| 56 | + grunt.loadNpmTasks('grunt-mocha-test'); | ||
| 47 | 57 | ||
| 48 | - grunt.registerTask("default", ["jshint", "uglify"]); | ||
| 49 | - grunt.registerTask("test", ["jshint", "mochaTest"]); | ||
| 58 | + grunt.registerTask('build', ['jshint', 'uglify']); | ||
| 59 | + grunt.registerTask('test', ['jshint', 'mochaTest']); | ||
| 50 | 60 | ||
| 51 | 61 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,9 @@ | |||
| 31 | 31 | "scripts": { | |
| 32 | 32 | "test": "grunt test" | |
| 33 | 33 | }, | |
| 34 | - "dependencies": {}, | ||
| 34 | + "dependencies": { | ||
| 35 | + "grunt-contrib-watch": "^0.6.1" | ||
| 36 | + }, | ||
| 35 | 37 | "devDependencies": { | |
| 36 | 38 | "chai": "~1.8.1", | |
| 37 | 39 | "grunt": "~0.4.2", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -177,7 +177,6 @@ PAYPAL.apps = PAYPAL.apps || {}; | |||
| 177 | 177 | // Primary | |
| 178 | 178 | css += '.paypal-button button { height: 26px; background: #009cde; border: 1px transparent; border-radius: 3px; color: #fff; }'; | |
| 179 | 179 | ||
| 180 | - | ||
| 181 | 180 | styleEl.type = 'text/css'; | |
| 182 | 181 | styleEl.id = 'paypal-button'; | |
| 183 | 182 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments