anchor.diff:    run('sed', arguments: [
       '-i',
       's,https://dart-services.appspot.com,${Platform.environment[backendVariable]},g',
  -    'build/web/scripts/main.dart.js',
  -    'build/web/scripts/embed.dart.js'
  -  ]);
  -  run('pub', arguments: ['run', 'dhttpd', '-p', '8000', '--path=build/web']);
  +    'build/scripts/main.dart.js',
  +    'build/scripts/embed.dart.js'
  +  ]);
  +  run('pub', arguments: ['run', 'dhttpd', '-p', '8000', '--path=build']);
   }
   
   @Task('Build the `web/index.html` entrypoint')
   build() {
  -  // Copy our third party python code into web/.
  -  FilePath('third_party/mdetect/mdetect.py').copy(_webDir);
  -
  -  // Copy the codemirror script into web/scripts.
  -  FilePath(_getCodeMirrorScriptPath()).copy(_webDir.join('scripts'));
  -
  -  // copy web/ resources
  -  copyDirectory(webDir, joinDir(buildDir, ['web']));
  -
  -  // copy lib/ resources
  -  copyDirectory(libDir, joinDir(buildDir, ['web', 'packages', 'dart_pad']));
  -
  -  // copy other package resources
  -  copyPackageResources('codemirror', joinDir(buildDir, ['web']));
  -
  -  // Compile main scripts.
  -  // Debugging: minify: false, extraArgs: ['--enable-asserts']
  -  Dart2js.compile(joinFile(webDir, ['scripts', 'main.dart']),
  -      outDir: joinDir(buildDir, ['web', 'scripts']), minify: true);
  -  Dart2js.compile(joinFile(webDir, ['scripts', 'embed.dart']),
  -      outDir: joinDir(buildDir, ['web', 'scripts']), minify: true);
  -
  -  FilePath mainFile = _buildDir.join('web', 'scripts/main.dart.js');
  +  PubApp.local('build_runner').run(['build', '-r', '-o', 'web:build']);
  +
  +  FilePath mainFile = _buildDir.join('scripts/main.dart.js');
     log('${mainFile} compiled to ${_printSize(mainFile)}');
   
     FilePath testFile = _buildDir.join('test', 'web.dart.js');
     if (testFile.exists)
       log('${testFile.path} compiled to ${_printSize(testFile)}');
   
  -  FilePath embedFile = _buildDir.join('web', 'scripts/embed.dart.js');
  +  FilePath embedFile = _buildDir.join('scripts/embed.dart.js');
     log('${mainFile} compiled to ${_printSize(embedFile)}');
   
     // Remove .dart files.
     int count = 0;
   
  -  for (FileSystemEntity entity in getDir('build/web/packages')
  +  for (FileSystemEntity entity in getDir('build/packages')
         .listSync(recursive: true, followLinks: false)) {
       if (entity is! File) continue;
       if (!entity.path.endsWith('.dart')) continue;
  
positive.code:       }
      }
  
      log('\nexecute: `gcloud app deploy build/web/app.yaml --project=dart-pad --no-promote`');
    });
  }
  
  
negative.code:   fail('package $packageName not found in .packages file');
  }
  
  // Run vulcanize
  vulcanize(String filepath) {
    FilePath htmlFile = _buildDir.join(filepath);
    log('${htmlFile.path} original: ${_printSize(htmlFile)}');
    ProcessResult result = Process.runSync(
        'vulcanize',
  