From 358997dfcd603e9f41f3504f6347671dc90e79bf Mon Sep 17 00:00:00 2001 From: Mike Francis Date: Wed, 1 Apr 2015 17:33:21 +0100 Subject: [PATCH] Swap out grunt, add in browserify --- Gruntfile.js | 96 ---------------------------------------------------- package.json | 48 +++++++++++++++++++++----- 2 files changed, 40 insertions(+), 104 deletions(-) delete mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 768e03d..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,96 +0,0 @@ -module.exports = function(grunt) { - - // Add your script files here in order of precedence - - var scripts = [ - 'js/script.js' - ]; - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - autoprefixer: { - single_file: { - options: { - browsers: ['last 2 versions', 'ie 8', 'ie 9'] - }, - files: { 'style.css': 'style.css' } - } - }, - imageoptim: { - src: ['img/'], - options: { - quitAfter: true - } - }, - sass: { - dist: { - options: { - outputStyle: 'compressed' - }, - files: { 'style.css': 'scss/style.scss' } - } - }, - svgmin: { - options: { - plugins: [{ - removeViewBox: false - }], - }, - dist: { - files: [{ - expand: true, - cwd: 'img/', - src: ['*.svg'], - dest: 'img/', - ext: '.svg' - }], - } - }, - svg2png: { - all: { - files: [{ - src: ['img/*.svg'], - dest: '.' - }], - } - }, - uglify: { - options: { - mangle: false - }, - all: { - files: { - 'js/script.min.js': scripts - } - } - }, - watch: { - css: { - files: ['scss/**/*.scss'], - tasks: ['sass', 'autoprefixer'], - options: { - livereload: true - } - }, - js: { - files: scripts, - tasks: ['uglify'], - options: { - livereload: true - } - } - } - }); - - grunt.loadNpmTasks('grunt-autoprefixer'); - grunt.loadNpmTasks('grunt-sass'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-imageoptim'); - grunt.loadNpmTasks('grunt-svg2png'); - grunt.loadNpmTasks('grunt-svgmin'); - - grunt.registerTask('img', ['svgmin', 'svg2png', 'imageoptim']); - grunt.registerTask('default', ['sass', 'uglify', 'watch']); - -}; diff --git a/package.json b/package.json index b9bd192..a7185f9 100755 --- a/package.json +++ b/package.json @@ -1,12 +1,44 @@ { + "name": "barebones", + "description": "A lightweight, skeletal, responsive WordPress boilerplate theme for HTML5 and beyond.", + "version": "2.0.0", + "license": "MIT", + "author": { + "name": "Benchmark", + "email": "hello@benchmark.co.uk", + "url": "http://www.benchmark.co.uk" + }, + "repository": { + "type": "git", + "url": "benchmarkstudios/barebones" + }, + "scripts": { + "compile-sass": "node-sass --output-style=compressed assets/scss/barebones.scss style.css", + "autoprefix-sass": "autoprefixer -b 'last 10 versions' --map style.css", + "process-sass": "npm run compile-sass && npm run autoprefix-sass", + "watch-sass": "fsmonitor -d 'assets/scss' -s '+*.scss' npm run process-sass", + "browserify-js": "browserify assets/js/script.js -o js/script.min.js", + "uglify-js": "uglifyjs js/script.min.js -o js/script.min.js -c", + "process-js": "npm run browserify-js && npm run uglify-js", + "watch-js": "fsmonitor -d 'assets/js' -s '+*.js' npm run process-js", + "watch": "livereload & npm run watch-sass & npm run watch-js" + }, + "browserify": { + "transform": [ + "browserify-global-shim" + ] + }, + "browserify-global-shim": { + "jquery": "$" + }, "devDependencies": { - "grunt": "~0.4.2", - "grunt-sass": "~0.17.0", - "grunt-contrib-watch": "~0.6.1", - "grunt-imageoptim": "~1.4.1", - "grunt-svg2png": "~0.2.0", - "grunt-svgmin": "~0.4.0", - "grunt-contrib-uglify": "~0.5.0", - "grunt-autoprefixer": "~0.8.2" + "browserify": "~9.0.4", + "browserify-shim": "~3.8.3", + "uglify-js": "~2.4.19", + "autoprefixer": "~5.1.0", + "node-sass": "~2.1.1", + "fsmonitor": "~0.2.4", + "livereload": "~0.3.6", + "browserify-global-shim": "~1.0.0" } }