module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: { dist: { options: { style: 'compressed' }, files: [{ expand: true, cwd: 'assets/styles', src: ['**/*.scss'], dest: 'public/css', ext: '.css' }] } }, uglify: { options: { mangle: false }, compile: { files: { 'public/js/nechryael.min.js': ['assets/js/**/*.js'] } } }, watch: { css: { files: ['assets/styles/**/*.scss'], tasks: ['sass'], options: { atBegin: true, spawn: false } }, js: { files: ['assets/js/**/*.js'], tasks: ['uglify'], options: { atBegin: true, spawn: false } } }, deb_package: { options: { maintainer: 'Gregory Ballantine ', long_description: 'A simple web app to track inventory records.', output: './dist/', }, build: { files: [ { cwd: './', src: 'index.js', dest: '/opt/overseer' }, { cwd: './', src: 'src/**/*', dest: '/opt/overseer/' }, { cwd: './', src: 'views/**/*', dest: '/opt/overseer/' }, { cwd: './', src: 'config/**/*', dest: '/opt/overseer/' }, { cwd: './', src: 'public/**/*', dest: '/opt/overseer/' }, { cwd: './build/etc/', src: 'production.json', dest: '/etc/overseer/' }, { cwd: './build/etc/', src: 'overseer.service', dest: '/etc/systemd/system/' }, { cwd: './', src: 'bin/**/*', dest: '/opt/overseer/' }, { cwd: './', src: 'node_modules/**/*', dest: '/opt/overseer/' }, { cwd: './', src: 'LICENSE', dest: '/opt/overseer/', }, ], links: { '/usr/bin/overseer': '/opt/overseer/bin/start.sh' }, scripts: { postinst: { src: './build/scripts/postinst.sh' }, }, }, } }); // Load plugins. grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-deb'); // CLI tasks. grunt.registerTask('default', ['sass', 'uglify']); grunt.registerTask('package', ['deb_package']); };