Created
May 4, 2015 05:40
-
-
Save onefriendaday/6b347b186171ec140688 to your computer and use it in GitHub Desktop.
Browserify Grunt example
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) { | |
| grunt.loadNpmTasks('grunt-contrib-sass'); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); | |
| grunt.loadNpmTasks('grunt-contrib-concat'); | |
| grunt.loadNpmTasks('grunt-browserify'); | |
| grunt.registerTask('default',['watch']); | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| sass: { | |
| dist: { | |
| files: { | |
| 'web/assets/css/style.css' : 'source/sass/style.scss' | |
| } | |
| } | |
| }, | |
| browserify: { | |
| options: { | |
| transform: ['vueify'] | |
| }, | |
| dist: { | |
| files: { | |
| 'web/assets/js/app.js': 'source/js/index.js' | |
| } | |
| } | |
| }, | |
| watch: { | |
| app: { | |
| files: ["source/js/**/*"], | |
| tasks: ["browserify"], | |
| options: { | |
| spawn: false, | |
| } | |
| }, | |
| libs: { | |
| files: ["bower_components/**/*"], | |
| tasks: ["concat"] | |
| }, | |
| css: { | |
| files: 'source/sass/*.scss', | |
| tasks: ['sass'], | |
| options: { | |
| livereload: true, | |
| } | |
| } | |
| }, | |
| concat: { | |
| options: { | |
| separator: ';', | |
| }, | |
| dist: { | |
| src: [ | |
| 'bower_components/jquery/dist/jquery.js', | |
| 'bower_components/uikit/js/uikit.js', | |
| 'bower_components/uikit/js/components/nestable.js', | |
| 'bower_components/humanize-plus/public/src/humanize.js', | |
| 'bower_components/hogan/web/builds/3.0.2/hogan-3.0.2.min.js' | |
| ], | |
| dest: 'web/assets/js/libs.js', | |
| }, | |
| }, | |
| }); | |
| grunt.registerTask('serve',[ | |
| 'concat', | |
| 'browserify', | |
| 'sass', | |
| 'watch' | |
| ]); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment