         eqnull: true,
         shadow: true
       },
-      files: [
-        'build/**/*.js'
-      ]
+      core: {
+        src: [
+          'build/scripts/**/*.js',
+          '!build/scripts/<%= pkg.name %>/ui.js',
+          '!build/scripts/<%= pkg.name %>/ui/**/*.js'
+        ]
+      },
+      ui: {
+        src: [
+          'build/scripts/<%= pkg.name %>/ui.js',
+          'build/scripts/<%= pkg.name %>/ui/**/*.js'
+        ]
+      }
     },
 
     # Minified distribution


    # Watch for file changes
    watch: {
      files: [
        'Gruntfile.coffee',
        'src/**/*'
      ],
      tasks: ['build']
    }
  }



    # Cleans build folders
    clean: {
      core: [
        'build/scripts/**/*.js',
        '!build/scripts/<%= pkg.name %>/ui.js',
        '!build/scripts/<%= pkg.name %>/ui/**/*.js'
      ],
      ui: [
        'build/scripts/<%= pkg.name %>/ui.js',
        'build/scripts/<%= pkg.name %>/ui/**/*.js'
      ]
    },

    # Compiles CoffeeScript source
    coffee: {
      options: {
        bare: true
      }
      core: {
        expand: true,
        cwd: 'src',
        src: [
          'scripts/**/*.coffee',
          '!scripts/<%= pkg.name %>/ui.coffee',
          '!scripts/<%= pkg.name %>/ui/**/*.coffee'
        ],
        dest: 'build',
        ext: '.js'
      },
      ui: {
        expand: true,
        cwd: 'src',
        src: [
          'scripts/<%= pkg.name %>/ui.coffee',
          'scripts/<%= pkg.name %>/ui/**/*.coffee'
        ],
        dest: 'build',
        ext: '.js'
      }
    },

