var os = require('os');

module.exports = function (grunt) {
	grunt.loadNpmTasks('grunt-build-atom-shell');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.file.setBase(require('path').resolve('..'));

	grunt.initConfig({
		'build-atom-shell': {
			tag: 'v0.22.2',
			nodeVersion: '0.22.0',
			buildDir: os.tmpdir() + '/atom-shell',
			projectName: 'nukebox',
			productName: 'Nukebox'
		},

		clean: {
			css: {
				src: [ 'src/resources/**/*.css' ]
			}
		},

		stylus: {
			options: {
				compress: true,
				'resolve url': true,
				use: [ require('nib') ]
			},

			compile: {
				files: { 'src/resources/nukebox.css': 'src/resources/nukebox.styl' }
			}
		},

		watch: {
			stylus: {
				files: [ 'src/resources/**/*.styl' ],
				tasks: [ 'stylus' ]
			}
		}
	});

	grunt.registerTask('default', [ 'stylus', 'watch' ]);
	grunt.registerTask('build', [ 'build-atom-shell', 'stylus' ]);
};

@@ -240,58 +240,252 @@
 ;%0A%0A%09
-grunt.file.setBase(require('path').resolve('..'));
+// Note: Paths below generally all start with .. since this file is within the build subfolder.%0A%09// Normally, atom-shell apps promote calling grunt.file.setBase to avoid this, but...%0A%09// https://github.com/gruntjs/grunt-contrib-watch/issues/426
 %0A%0A%09g
@@ -613,16 +613,47 @@
 shell',%0A
+%09%09%09targetDir: '../atom-shell',%0A
 %09%09%09proje
@@ -714,16 +714,123 @@
 lean: %7B%0A
+%09%09%09options: %7B%0A%09%09%09%09force: true // Unfortunately necessary due to this being under the build subfolder%0A%09%09%09%7D,%0A
 %09%09%09css: 
@@ -839,24 +839,27 @@
 %09%09%09%09src: %5B '
+../
 src/resource
@@ -1017,16 +1017,19 @@
 les: %7B '
+../
 src/reso
@@ -1049,16 +1049,19 @@
 .css': '
+../
 src/reso
@@ -1131,16 +1131,19 @@
 les: %5B '
+../
 src/reso

Modify Gruntfile so grunt-contrib-watch actually works