Repository: oppia/oppia

Issue:
Remove separate TypeScript compilation.
**Current situation**
Currently, most of the `.ts` files that we have are compiled through Webpack, only a few remaining files and folders are [compiled separately with TypeScript](https://github.com/oppia/oppia/blob/05094e9226d599f662f5e92842346b3763aa991a/scripts/build.py#L1315). The files and folders are listed in [tsconfig.json](https://github.com/oppia/oppia/blob/develop/tsconfig.json#L27). These last remaining files and folders are also the reason why we need to have two separate ts configs ([tsconfig-for-compile-check.json](https://github.com/oppia/oppia/blob/develop/tsconfig-for-compile-check.json)).

**Expected solution**
Remove remainig files and folders from tsconfig.ts:
- karma-globals.ts
  - can be removed after last GLOBAL is removed from frontend tests

After all the files and folders are removed, all the separate TypeScript compilations should be removed and also all references to `local_compiled_js` folder that was generated by that compilation should be removed.

The last step should be to replace `tsconfig.json` with `tsconfig-for-compile-check.json`.



Remove separate TypeScript compilation.
**Current situation**
Currently, most of the `.ts` files that we have are compiled through Webpack, only a few remaining files and folders are [compiled separately with TypeScript](https://github.com/oppia/oppia/blob/05094e9226d599f662f5e92842346b3763aa991a/scripts/build.py#L1315). The files and folders are listed in [tsconfig.json](https://github.com/oppia/oppia/blob/develop/tsconfig.json#L27). These last remaining files and folders are also the reason why we need to have two separate ts configs ([tsconfig-for-compile-check.json](https://github.com/oppia/oppia/blob/develop/tsconfig-for-compile-check.json)).

**Expected solution**
Remove remainig files and folders from tsconfig.ts:
- karma-globals.ts
  - can be removed after last GLOBAL is removed from frontend tests

After all the files and folders are removed, all the separate TypeScript compilations should be removed and also all references to `local_compiled_js` folder that was generated by that compilation should be removed.

The last step should be to replace `tsconfig.json` with `tsconfig-for-compile-check.json`.





Discussion:
Hey I'm new here can I try this task as my first good issue @vojtechjelinek 
@rajitha1998 Sure you can, I have assigned you. If you have any questions just ask here.
I removed mathjaxConfig.ts, expression-parser.service.js from tsconfig.json, now I have to deal with karma-globals.ts and other two folders.

can you explain me a bit more about how to remove last Global from front-end tests and the process of removing other two folders.
@Jamesjay4199 Do you have any suggestion regarding the last global in FE tests?

`typings` folder should be obvious from the issue description. `extensions/ckeditor_plugins` contains the `pre` plugin which is loaded in [ck-editor-4-rte.directive.ts](https://github.com/oppia/oppia/blob/develop/core/templates/dev/head/components/ck-editor-helpers/ck-editor-4-rte.directive.ts#L98) but since it is loaded directly by CKEditor it needs to be some standalone JS file. Two solutions are proposed both are creating a bit of exception in our codebase:
 - The first is to add this file as an [entry point](https://webpack.js.org/concepts/entry-points/) into webpack.common.config.ts, that would mean it would be compiled from TypeScript to JavaScript by webpack and provided into the `webpack_bundles` folder, but I now realize that this would also mean that we would need to handle prod mode when the filename would also contain hash which could be quite complicated.
 - The second is to change the file into JavaScript (this might mean just to change the `.ts` to `.js` but also maybe some change in the file content) and have it as an exception. @kevinlee12 would this be okay from your POW?
It's fine to do the second one, since the first option isn't great. However, if @Jamesjay4199 has other suggestions, I'm all ears for that one. 
![Screenshot from 2019-09-28 20-30-06](https://user-images.githubusercontent.com/36359382/65818706-cb15f700-e231-11e9-8ebd-130843ddc50f.png)

The file ck-editor-4-rte.directive.ts shows me an error in VScode. Regardless of the error I ran a

`npx tsc  ck-editor-4-rte.directive.ts`

It converted the `ts` into `js` but there were errors showing up in the process (I think that was because there were already some errors in the typescript file)
![Screenshot from 2019-09-28 20-30-46](https://user-images.githubusercontent.com/36359382/65818730-10d2bf80-e232-11e9-8597-97740df96734.png)

But the `js` file does not show any errors.
@vojtechjelinek 
Hey I'm new here can I try this task as my first good issue @vojtechjelinek 
@rajitha1998 Sure you can, I have assigned you. If you have any questions just ask here.
I removed mathjaxConfig.ts, expression-parser.service.js from tsconfig.json, now I have to deal with karma-globals.ts and other two folders.

can you explain me a bit more about how to remove last Global from front-end tests and the process of removing other two folders.
@Jamesjay4199 Do you have any suggestion regarding the last global in FE tests?

`typings` folder should be obvious from the issue description. `extensions/ckeditor_plugins` contains the `pre` plugin which is loaded in [ck-editor-4-rte.directive.ts](https://github.com/oppia/oppia/blob/develop/core/templates/dev/head/components/ck-editor-helpers/ck-editor-4-rte.directive.ts#L98) but since it is loaded directly by CKEditor it needs to be some standalone JS file. Two solutions are proposed both are creating a bit of exception in our codebase:
 - The first is to add this file as an [entry point](https://webpack.js.org/concepts/entry-points/) into webpack.common.config.ts, that would mean it would be compiled from TypeScript to JavaScript by webpack and provided into the `webpack_bundles` folder, but I now realize that this would also mean that we would need to handle prod mode when the filename would also contain hash which could be quite complicated.
 - The second is to change the file into JavaScript (this might mean just to change the `.ts` to `.js` but also maybe some change in the file content) and have it as an exception. @kevinlee12 would this be okay from your POW?
It's fine to do the second one, since the first option isn't great. However, if @Jamesjay4199 has other suggestions, I'm all ears for that one. 
![Screenshot from 2019-09-28 20-30-06](https://user-images.githubusercontent.com/36359382/65818706-cb15f700-e231-11e9-8ebd-130843ddc50f.png)

The file ck-editor-4-rte.directive.ts shows me an error in VScode. Regardless of the error I ran a

`npx tsc  ck-editor-4-rte.directive.ts`

It converted the `ts` into `js` but there were errors showing up in the process (I think that was because there were already some errors in the typescript file)
![Screenshot from 2019-09-28 20-30-46](https://user-images.githubusercontent.com/36359382/65818730-10d2bf80-e232-11e9-8597-97740df96734.png)

But the `js` file does not show any errors.
@vojtechjelinek 

Resolving patch:
diff --git a/scripts/build.py b/scripts/build.py
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -34,10 +34,6 @@
 ASSETS_DEV_DIR = os.path.join('assets', '')
 ASSETS_OUT_DIR = os.path.join('build', 'assets', '')
 
-COMPILED_JS_DIR = os.path.join('local_compiled_js', '')
-TSC_OUTPUT_LOG_FILEPATH = 'tsc_output_log.txt'
-TSCONFIG_FILEPATH = 'tsconfig.json'
-
 THIRD_PARTY_STATIC_DIR = os.path.join('third_party', 'static')
 THIRD_PARTY_GENERATED_DEV_DIR = os.path.join('third_party', 'generated', '')
 THIRD_PARTY_GENERATED_OUT_DIR = os.path.join(
@@ -55,15 +51,12 @@
 
 EXTENSIONS_DIRNAMES_TO_DIRPATHS = {
     'dev_dir': os.path.join('extensions', ''),
-    'compiled_js_dir': os.path.join('local_compiled_js', 'extensions', ''),
     'staging_dir': os.path.join('backend_prod_files', 'extensions', ''),
     'out_dir': os.path.join('build', 'extensions', '')
 }
 TEMPLATES_DEV_DIR = os.path.join('templates', 'dev', 'head', '')
 TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS = {
     'dev_dir': os.path.join('core', 'templates', 'dev', 'head', ''),
-    'compiled_js_dir': os.path.join(
-        'local_compiled_js', 'core', 'templates', 'dev', 'head', ''),
     'staging_dir': os.path.join('backend_prod_files', 'templates', 'head', ''),
     'out_dir': os.path.join('build', 'templates', 'head', '')
 }
@@ -87,7 +80,6 @@
 PARENT_DIR = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
 UGLIFY_FILE = os.path.join('node_modules', 'uglify-js', 'bin', 'uglifyjs')
 WEBPACK_FILE = os.path.join('node_modules', 'webpack', 'bin', 'webpack.js')
-TSC_BIN_FILE = os.path.join('node_modules', 'typescript', 'bin', 'tsc')
 WEBPACK_PROD_CONFIG = 'webpack.prod.config.ts'
 
 # Files with these extensions shouldn't be moved to build directory.
@@ -150,33 +142,6 @@
 _PARSER.add_argument(
     '--minify_third_party_libs_only', action='store_true', default=False,
     dest='minify_third_party_libs_only')
-_PARSER.add_argument(
-    '--enable_watcher', action='store_true', default=False)
-
-
-def convert_filepath_to_hashed_url(filepath, hashes):
-    """Convert the original filepath to url with hash inserted.
-
-    Args:
-        filepath: str. The original file path.
-        hashes: str. The calculated hash for this file.
-
-    Returns:
-        str. Generated url style path with hash inserted.
-    """
-    return _insert_hash(common.convert_to_posixpath(filepath), hashes)
-
-
-def convert_filepath_to_url(filepath):
-    """Convert the original filepath to url path.
-
-    Args:
-        filepath: str. The original file path.
-
-    Returns:
-        str. Generated url style path.
-    """
-    return common.convert_to_posixpath(filepath)
 
 
 def generate_app_yaml():
@@ -197,25 +162,6 @@ def generate_app_yaml():
         prod_yaml_file.write(content)
 
 
-def require_compiled_js_dir_to_be_valid():
-    """Checks if COMPILED_JS_DIR matches the output directory used in
-    TSCONFIG_FILEPATH.
-
-    Raises:
-        Exception: The COMPILED_JS_DIR does not match the outDir in
-            TSCONFIG_FILEPATH.
-    """
-
-    out_dir = ''
-    with python_utils.open_file(TSCONFIG_FILEPATH, 'r') as f:
-        config_data = json.load(f)
-        out_dir = os.path.join(config_data['compilerOptions']['outDir'], '')
-    if out_dir != COMPILED_JS_DIR:
-        raise Exception(
-            'COMPILED_JS_DIR: %s does not match the output directory '
-            'in %s: %s' % (COMPILED_JS_DIR, TSCONFIG_FILEPATH, out_dir))
-
-
 def _minify(source_path, target_path):
     """Runs the given file through a minifier and outputs it to target_path.
 
@@ -423,7 +369,7 @@ def _compare_file_count(
                 file_counts[0], file_counts[1]))
 
 
-def process_html(source_file_stream, target_file_stream, file_hashes):
+def process_html(source_file_stream, target_file_stream):
     """Remove whitespaces and add hashes to filepaths in the HTML file stream
     object.
 
@@ -432,51 +378,9 @@ def process_html(source_file_stream, target_file_stream, file_hashes):
             read from.
         target_file_stream: file. The stream object to write the minified HTML
             file to.
-        file_hashes: dict(str, str). Dictionary with filepaths as keys and
-            hashes of file content as values.
     """
-    content = source_file_stream.read()
-    for filepath, file_hash in file_hashes.items():
-        # We are adding hash in all file paths except for html paths.
-        # This is because html paths are used by backend and we work with
-        # paths without hash part in backend.
-        if not filepath.endswith('.html'):
-            # This reconstructs the hashed version of the URL, so that it can
-            # be used to substitute the raw URL in the HTML file stream.
-            filepath_with_hash = convert_filepath_to_hashed_url(
-                filepath, file_hash)
-            content = content.replace(
-                # This and the following lines, convert the original file paths
-                # to URL paths, so the URLs in HTML files can be replaced.
-                '%s%s' % (
-                    convert_filepath_to_url(TEMPLATES_DEV_DIR),
-                    filepath),
-                '%s%s' % (
-                    convert_filepath_to_url(
-                        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['out_dir']),
-                    filepath_with_hash))
-            content = content.replace(
-                '%s%s' % (
-                    convert_filepath_to_url(ASSETS_DEV_DIR), filepath),
-                '%s%s' % (
-                    convert_filepath_to_url(ASSETS_OUT_DIR),
-                    filepath_with_hash))
-            content = content.replace(
-                '%s%s' % (
-                    convert_filepath_to_url(
-                        EXTENSIONS_DIRNAMES_TO_DIRPATHS['dev_dir']), filepath),
-                '%s%s' % (
-                    convert_filepath_to_url(
-                        EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir']),
-                    filepath_with_hash))
-            content = content.replace(
-                '%s%s' % (convert_filepath_to_url(
-                    THIRD_PARTY_GENERATED_DEV_DIR), filepath),
-                '%s%s' % (
-                    convert_filepath_to_url(
-                        THIRD_PARTY_GENERATED_OUT_DIR), filepath_with_hash))
-    content = REMOVE_WS(' ', content)
-    write_to_file_stream(target_file_stream, content)
+    write_to_file_stream(
+        target_file_stream, REMOVE_WS(' ', source_file_stream.read()))
 
 
 def get_dependency_directory(dependency):
@@ -890,7 +794,7 @@ def save_hashes_to_file(file_hashes):
         hashes_json_file.write(u'\n')
 
 
-def minify_func(source_path, target_path, file_hashes, filename):
+def minify_func(source_path, target_path, filename):
     """Call the appropriate functions to handle different types of file
     formats:
         - HTML files: Remove whitespaces, interpolates paths in HTML to include
@@ -905,7 +809,7 @@ def minify_func(source_path, target_path, file_hashes, filename):
         with python_utils.open_file(source_path, 'r+') as source_html_file:
             with python_utils.open_file(
                 target_path, 'w+') as minified_html_file:
-                process_html(source_html_file, minified_html_file, file_hashes)
+                process_html(source_html_file, minified_html_file)
     elif ((filename.endswith('.css') or filename.endswith('.js')) and
           not skip_minify):
         python_utils.PRINT('Minifying %s' % source_path)
@@ -937,8 +841,7 @@ def _execute_tasks(tasks, batch_size=24):
                 raise OSError('threads can only be started once')
 
 
-def generate_build_tasks_to_build_all_files_in_directory(
-        source, target, file_hashes):
+def generate_build_tasks_to_build_all_files_in_directory(source, target):
     """This function queues up tasks to build all files in a directory,
     excluding files that should not be built.
 
@@ -947,8 +850,6 @@ def generate_build_tasks_to_build_all_files_in_directory(
             files and directories to be built.
         target: str. Path relative to /oppia of directory where the built files
             and directories will be saved to.
-        file_hashes: dict(str, str). Dictionary with filepaths as keys and
-            hashes of file content as values.
 
     Returns:
         deque(Thread). A deque that contains all build tasks queued
@@ -969,13 +870,13 @@ def generate_build_tasks_to_build_all_files_in_directory(
             if should_file_be_built(source_path):
                 task = threading.Thread(
                     target=minify_func,
-                    args=(source_path, target_path, file_hashes, filename,))
+                    args=(source_path, target_path, filename,))
                 build_tasks.append(task)
     return build_tasks
 
 
 def generate_build_tasks_to_build_files_from_filepaths(
-        source_path, target_path, filepaths, file_hashes):
+        source_path, target_path, filepaths):
     """This function queues up build tasks to build files from a list of
     filepaths, excluding files that should not be built.
 
@@ -985,8 +886,6 @@ def generate_build_tasks_to_build_files_from_filepaths(
         target_path: str. Path relative to /oppia directory of directory where
             to copy the files and directories.
         filepaths: list(str). List of filepaths to be built.
-        file_hashes: dict(str, str). Dictionary with filepaths as keys and
-            hashes of file content as values.
 
     Returns:
         deque(Thread). A deque that contains all build tasks queued
@@ -1001,7 +900,7 @@ def generate_build_tasks_to_build_files_from_filepaths(
             task = threading.Thread(
                 target=minify_func,
                 args=(
-                    source_file_path, target_file_path, file_hashes, filepath,))
+                    source_file_path, target_file_path, filepath,))
             build_tasks.append(task)
     return build_tasks
 
@@ -1087,7 +986,7 @@ def get_recently_changed_filenames(source_dir_hashes, out_dir):
     return recently_changed_filenames
 
 
-def generate_build_tasks_to_build_directory(dirnames_dict, file_hashes):
+def generate_build_tasks_to_build_directory(dirnames_dict):
     """This function queues up build tasks to build all files in source
     directory if there is no existing staging directory. Otherwise, selectively
     queue up build tasks to build recently changed files.
@@ -1096,21 +995,16 @@ def generate_build_tasks_to_build_directory(dirnames_dict, file_hashes):
         dirnames_dict: dict(str, str). This dict should contain three keys,
             with corresponding values as follows:
             - 'dev_dir': the directory that contains source files to be built.
-            - 'compiled_js_dir': the directory that contains compiled js files
-                to be built.
             - 'staging_dir': the directory that contains minified files waiting
                 for final copy process.
             - 'out_dir': the final directory that contains built files with hash
                 inserted into filenames.
-        file_hashes: dict(str, str). Dictionary with filepaths as keys and
-            hashes of file content as values.
 
     Returns:
         deque(Thread). A deque that contains all build tasks queued
             to be processed.
     """
     source_dir = dirnames_dict['dev_dir']
-    compiled_js_dir = dirnames_dict['compiled_js_dir']
     staging_dir = dirnames_dict['staging_dir']
     out_dir = dirnames_dict['out_dir']
     build_tasks = collections.deque()
@@ -1119,9 +1013,7 @@ def generate_build_tasks_to_build_directory(dirnames_dict, file_hashes):
         python_utils.PRINT('Creating new %s folder' % staging_dir)
         ensure_directory_exists(staging_dir)
         build_tasks += generate_build_tasks_to_build_all_files_in_directory(
-            source_dir, staging_dir, file_hashes)
-        build_tasks += generate_build_tasks_to_build_all_files_in_directory(
-            compiled_js_dir, staging_dir, file_hashes)
+            source_dir, staging_dir)
     else:
         # If staging dir exists, rebuild all HTML and Python files.
         file_extensions_to_always_rebuild = ('.html', '.py',)
@@ -1132,15 +1024,12 @@ def generate_build_tasks_to_build_directory(dirnames_dict, file_hashes):
         filenames_to_always_rebuild = get_filepaths_by_extensions(
             source_dir, file_extensions_to_always_rebuild)
         build_tasks += generate_build_tasks_to_build_files_from_filepaths(
-            source_dir, staging_dir, filenames_to_always_rebuild, file_hashes)
+            source_dir, staging_dir, filenames_to_always_rebuild)
 
         dev_dir_hashes = get_file_hashes(source_dir)
 
-        compiled_js_dir_hashes = get_file_hashes(compiled_js_dir)
-
         source_hashes = {}
         source_hashes.update(dev_dir_hashes)
-        source_hashes.update(compiled_js_dir_hashes)
 
         # Clean up files in staging directory that cannot be found in file
         # hashes dictionary.
@@ -1156,23 +1045,7 @@ def generate_build_tasks_to_build_directory(dirnames_dict, file_hashes):
             python_utils.PRINT(
                 'Re-building recently changed files at %s' % source_dir)
             build_tasks += generate_build_tasks_to_build_files_from_filepaths(
-                source_dir, staging_dir, recently_changed_filenames,
-                file_hashes)
-        else:
-            python_utils.PRINT(
-                'No changes detected. Using previously built files.')
-
-        python_utils.PRINT(
-            'Getting files that have changed between %s and %s'
-            % (compiled_js_dir, out_dir))
-        recently_changed_filenames = get_recently_changed_filenames(
-            compiled_js_dir_hashes, out_dir)
-        if recently_changed_filenames:
-            python_utils.PRINT(
-                'Re-building recently changed files at %s' % source_dir)
-            build_tasks += generate_build_tasks_to_build_files_from_filepaths(
-                compiled_js_dir, staging_dir, recently_changed_filenames,
-                file_hashes)
+                source_dir, staging_dir, recently_changed_filenames)
         else:
             python_utils.PRINT(
                 'No changes detected. Using previously built files.')
@@ -1281,9 +1154,7 @@ def generate_hashes():
     # Create hashes for all directories and files.
     HASH_DIRS = [
         ASSETS_DEV_DIR, EXTENSIONS_DIRNAMES_TO_DIRPATHS['dev_dir'],
-        EXTENSIONS_DIRNAMES_TO_DIRPATHS['compiled_js_dir'],
         TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['dev_dir'],
-        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['compiled_js_dir'],
         THIRD_PARTY_GENERATED_DEV_DIR]
     for HASH_DIR in HASH_DIRS:
         hashes.update(get_file_hashes(HASH_DIR))
@@ -1312,10 +1183,10 @@ def generate_build_directory(hashes):
 
     # Build files in /extensions and copy them into staging directory.
     build_tasks += generate_build_tasks_to_build_directory(
-        EXTENSIONS_DIRNAMES_TO_DIRPATHS, hashes)
+        EXTENSIONS_DIRNAMES_TO_DIRPATHS)
     # Minify all template files and copy them into staging directory.
     build_tasks += generate_build_tasks_to_build_directory(
-        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS, hashes)
+        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS)
     _execute_tasks(build_tasks)
 
     # Copy all files from staging directory to production directory.
@@ -1352,14 +1223,12 @@ def generate_build_directory(hashes):
         SOURCE_DIRS_FOR_WEBPACK, OUTPUT_DIRS_FOR_WEBPACK)
 
     SOURCE_DIRS_FOR_EXTENSIONS = [
-        EXTENSIONS_DIRNAMES_TO_DIRPATHS['dev_dir'],
-        EXTENSIONS_DIRNAMES_TO_DIRPATHS['compiled_js_dir']]
+        EXTENSIONS_DIRNAMES_TO_DIRPATHS['dev_dir']]
     OUTPUT_DIRS_FOR_EXTENSIONS = [EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir']]
     _compare_file_count(SOURCE_DIRS_FOR_EXTENSIONS, OUTPUT_DIRS_FOR_EXTENSIONS)
 
     SOURCE_DIRS_FOR_TEMPLATES = [
-        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['dev_dir'],
-        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['compiled_js_dir']]
+        TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['dev_dir']]
     OUTPUT_DIRS_FOR_TEMPLATES = [
         TEMPLATES_CORE_DIRNAMES_TO_DIRPATHS['out_dir']]
     _compare_file_count(SOURCE_DIRS_FOR_TEMPLATES, OUTPUT_DIRS_FOR_TEMPLATES)
@@ -1367,54 +1236,6 @@ def generate_build_directory(hashes):
     python_utils.PRINT('Build completed.')
 
 
-def compile_typescript_files(project_dir):
-    """Compiles typescript files to produce javascript files in
-    local_compiled_js folder.
-
-    Args:
-        project_dir: str. The project directory which contains the ts files
-            to be compiled.
-    """
-    require_compiled_js_dir_to_be_valid()
-    safe_delete_directory_tree(COMPILED_JS_DIR)
-    python_utils.PRINT('Compiling ts files...')
-    cmd = [
-        common.NODE_BIN_PATH, TSC_BIN_FILE, '--project',
-        project_dir]
-    subprocess.check_call(cmd)
-
-
-def compile_typescript_files_continuously(project_dir):
-    """Compiles typescript files continuously i.e enable a watcher which
-    monitors any changes in js files and recompiles them to ts files.
-
-    Args:
-        project_dir: str. The project directory which contains the ts files
-            to be compiled.
-    """
-    require_compiled_js_dir_to_be_valid()
-    safe_delete_directory_tree(COMPILED_JS_DIR)
-    python_utils.PRINT('Compiling ts files in watch mode...')
-    cmd = [
-        common.NODE_BIN_PATH, './node_modules/typescript/bin/tsc', '--project',
-        project_dir, '--watch']
-
-    with python_utils.open_file('tsc_output_log.txt', 'w') as out:
-        subprocess.Popen(cmd, stdout=out)
-
-    while True:
-        with python_utils.open_file(TSC_OUTPUT_LOG_FILEPATH, 'r') as f:
-            lines = f.readlines()
-            if len(lines):
-                # We are checking only the last line here since whenever
-                # typescript is done with initial compilation with or
-                # without errors, the last line will always read
-                # 'Found x errors. Watching for file changes'.
-                last_output = lines[len(lines) - 1]
-                if 'Watching for file changes' in last_output:
-                    return
-
-
 def main(args=None):
     """The main method of this script."""
     options = _PARSER.parse_args(args=args)
@@ -1422,11 +1243,6 @@ def main(args=None):
     safe_delete_directory_tree(THIRD_PARTY_GENERATED_DEV_DIR)
     build_third_party_libs(THIRD_PARTY_GENERATED_DEV_DIR)
 
-    if not options.enable_watcher:
-        compile_typescript_files('.')
-    else:
-        compile_typescript_files_continuously('.')
-
     # If minify_third_party_libs_only is set to True, skips the rest of the
     # build process once third party libs are minified.
     if options.minify_third_party_libs_only and not options.prod_mode:
diff --git a/scripts/start.py b/scripts/start.py
--- a/scripts/start.py
+++ b/scripts/start.py
@@ -110,7 +110,7 @@ def main(args=None):
             python_utils.PRINT(
                 re.sub(
                     r'"DEV_MODE": .*', constants_env_variable, line), end='')
-        build.main(args=['--prod_env', '--enable_watcher'])
+        build.main(args=['--prod_env'])
         app_yaml_filepath = 'app.yaml'
     else:
         constants_env_variable = '"DEV_MODE": true'
@@ -121,7 +121,7 @@ def main(args=None):
             python_utils.PRINT(
                 re.sub(
                     r'"DEV_MODE": .*', constants_env_variable, line), end='')
-        build.main(args=['--enable_watcher'])
+        build.main(args=[])
         app_yaml_filepath = 'app_dev.yaml'
 
     # Set up a local dev instance.
diff --git a/scripts/typescript_checks.py b/scripts/typescript_checks.py
--- a/scripts/typescript_checks.py
+++ b/scripts/typescript_checks.py
@@ -25,7 +25,7 @@
 import python_utils
 
 COMPILED_JS_DIR = os.path.join('local_compiled_js_for_test', '')
-TSCONFIG_FILEPATH = 'tsconfig-for-compile-check.json'
+TSCONFIG_FILEPATH = 'tsconfig.json'
 
 
 def validate_compiled_js_dir():


Test patch:
diff --git a/scripts/build_test.py b/scripts/build_test.py
--- a/scripts/build_test.py
+++ b/scripts/build_test.py
@@ -20,7 +20,6 @@
 
 # pylint: disable=invalid-name
 import collections
-import json
 import os
 import random
 import re
@@ -39,16 +38,8 @@
 
 MOCK_ASSETS_DEV_DIR = os.path.join(TEST_SOURCE_DIR, 'assets', '')
 MOCK_ASSETS_OUT_DIR = os.path.join(TEST_DIR, 'static', 'assets', '')
-
 MOCK_EXTENSIONS_DEV_DIR = os.path.join(TEST_SOURCE_DIR, 'extensions', '')
-MOCK_EXTENSIONS_COMPILED_JS_DIR = os.path.join(
-    TEST_SOURCE_DIR, 'local_compiled_js', 'extensions', '')
-
 MOCK_TEMPLATES_DEV_DIR = os.path.join(TEST_SOURCE_DIR, 'templates', '')
-MOCK_TEMPLATES_COMPILED_JS_DIR = os.path.join(
-    TEST_SOURCE_DIR, 'local_compiled_js', 'templates', '')
-
-MOCK_COMPILED_JS_DIR = os.path.join(TEST_SOURCE_DIR, 'compiled_js_dir', '')
 
 MOCK_TSC_OUTPUT_LOG_FILEPATH = os.path.join(
     TEST_SOURCE_DIR, 'mock_tsc_output_log.txt')
@@ -192,11 +183,8 @@ def test_compare_file_count(self):
             build._compare_file_count([EMPTY_DIR], [MOCK_ASSETS_DEV_DIR])
 
         # Test when one of the lists contain multiple directories.
-        MOCK_EXTENSIONS_DIR_LIST = [
-            MOCK_EXTENSIONS_DEV_DIR, MOCK_EXTENSIONS_COMPILED_JS_DIR]
-        target_dir_file_count = build.get_file_count(
-            MOCK_EXTENSIONS_DEV_DIR) + build.get_file_count(
-                MOCK_EXTENSIONS_COMPILED_JS_DIR)
+        MOCK_EXTENSIONS_DIR_LIST = [MOCK_EXTENSIONS_DEV_DIR]
+        target_dir_file_count = build.get_file_count(MOCK_EXTENSIONS_DEV_DIR)
 
         # Ensure that MOCK_EXTENSIONS_DIR has at least 1 file.
         assert target_dir_file_count > 0
@@ -247,26 +235,13 @@ def test_verify_filepath_hash(self):
             build._verify_filepath_hash(hashed_base_filename, file_hashes)
 
     def test_process_html(self):
-        """Test process_html removes whitespaces and adds hash to filepaths."""
-        BASE_HTML_SOURCE_PATH = os.path.join(
-            MOCK_TEMPLATES_DEV_DIR, 'base.html')
-        BASE_JS_RELATIVE_PATH = os.path.join('pages', 'Base.js')
-        BASE_JS_FILE_URL = 'pages/Base.js'
-        BASE_JS_SOURCE_PATH = os.path.join(
-            MOCK_TEMPLATES_COMPILED_JS_DIR, BASE_JS_RELATIVE_PATH)
-
-        build._ensure_files_exist([BASE_HTML_SOURCE_PATH, BASE_JS_SOURCE_PATH])
+        """Test process_html removes whitespaces."""
+        BASE_HTML_SOURCE_PATH = (
+            os.path.join(MOCK_TEMPLATES_DEV_DIR, 'base.html'))
+
+        build._ensure_files_exist([BASE_HTML_SOURCE_PATH])
         # Prepare a file_stream object from python_utils.string_io().
         minified_html_file_stream = python_utils.string_io()
-        # Obtain actual file hashes of /templates to add hash to all filepaths
-        # within the HTML file. The end result will look like:
-        # E.g <script ... App.js></script>
-        # --> <script ... App.[hash].js></script>.
-        # Only need to hash Base.js.
-        with self.swap(build, 'FILE_EXTENSIONS_TO_IGNORE', ('.html',)):
-            file_hashes = build.get_file_hashes(MOCK_TEMPLATES_DEV_DIR)
-            file_hashes.update(
-                build.get_file_hashes(MOCK_TEMPLATES_COMPILED_JS_DIR))
 
         # Assert that base.html has white spaces and has original filepaths.
         with python_utils.open_file(
@@ -276,36 +251,22 @@ def test_process_html(self):
                 source_base_file_content, r'\s{2,}',
                 msg='No white spaces detected in %s unexpectedly'
                 % BASE_HTML_SOURCE_PATH)
-            # Look for templates/pages/Base.js in source_base_file_content.
-            self.assertIn(
-                BASE_JS_FILE_URL, source_base_file_content)
 
         # Build base.html file.
         with python_utils.open_file(
             BASE_HTML_SOURCE_PATH, 'r') as source_base_file:
-            build.process_html(
-                source_base_file, minified_html_file_stream, file_hashes)
+            build.process_html(source_base_file, minified_html_file_stream)
 
         minified_html_file_content = minified_html_file_stream.getvalue()
         self.assertNotRegexpMatches(
             minified_html_file_content, r'\s{2,}',
             msg='All white spaces must be removed from %s' %
             BASE_HTML_SOURCE_PATH)
-        # Assert that hashes are inserted into filenames in base.html.
-        # Final filepath in base.html example:
-        # /build/templates/head/pages/Base.081ce90f17ecdf07701d83cb860985c2.js.
-        final_filename = build._insert_hash(
-            BASE_JS_FILE_URL, file_hashes[BASE_JS_RELATIVE_PATH])
-        # Look for templates/pages/Base.081ce90f17ecdf07701d83cb860985c2.js in
-        # minified_html_file_content.
-        self.assertIn(final_filename, minified_html_file_content)
 
     def test_should_file_be_built(self):
         """Test should_file_be_built returns the correct boolean value for
         filepath that should be built.
         """
-        service_js_filepath = os.path.join(
-            'local_compiled_js', 'core', 'pages', 'AudioService.js')
         service_ts_filepath = os.path.join('core', 'pages', 'AudioService.ts')
         spec_js_filepath = os.path.join('core', 'pages', 'AudioServiceSpec.js')
         protractor_filepath = os.path.join('extensions', 'protractor.js')
@@ -318,7 +279,6 @@ def test_should_file_be_built(self):
 
         self.assertFalse(build.should_file_be_built(spec_js_filepath))
         self.assertFalse(build.should_file_be_built(protractor_filepath))
-        self.assertTrue(build.should_file_be_built(service_js_filepath))
 
         self.assertFalse(build.should_file_be_built(service_ts_filepath))
 
@@ -330,7 +290,6 @@ def test_should_file_be_built(self):
         # ALL JS files that ends with ...Service.js should not be built.
         with self.swap(
             build, 'JS_FILENAME_SUFFIXES_TO_IGNORE', ('Service.js',)):
-            self.assertFalse(build.should_file_be_built(service_js_filepath))
             self.assertTrue(build.should_file_be_built(spec_js_filepath))
 
     def test_hash_should_be_inserted(self):
@@ -518,13 +477,12 @@ def test_generate_build_tasks_to_build_all_files_in_directory(self):
         the same number of build tasks as the number of files in the source
         directory.
         """
-        asset_hashes = build.get_file_hashes(MOCK_ASSETS_DEV_DIR)
         tasks = collections.deque()
 
         self.assertEqual(len(tasks), 0)
         # Build all files.
         tasks = build.generate_build_tasks_to_build_all_files_in_directory(
-            MOCK_ASSETS_DEV_DIR, MOCK_ASSETS_OUT_DIR, asset_hashes)
+            MOCK_ASSETS_DEV_DIR, MOCK_ASSETS_OUT_DIR)
         total_file_count = build.get_file_count(MOCK_ASSETS_DEV_DIR)
         self.assertEqual(len(tasks), total_file_count)
 
@@ -535,13 +493,12 @@ def test_generate_build_tasks_to_build_files_from_filepaths(self):
         new_filename = 'manifest.json'
         recently_changed_filenames = [
             os.path.join(MOCK_ASSETS_DEV_DIR, new_filename)]
-        asset_hashes = build.get_file_hashes(MOCK_ASSETS_DEV_DIR)
         build_tasks = collections.deque()
 
         self.assertEqual(len(build_tasks), 0)
         build_tasks += build.generate_build_tasks_to_build_files_from_filepaths(
             MOCK_ASSETS_DEV_DIR, MOCK_ASSETS_OUT_DIR,
-            recently_changed_filenames, asset_hashes)
+            recently_changed_filenames)
         self.assertEqual(len(build_tasks), len(recently_changed_filenames))
 
         build_tasks.clear()
@@ -552,8 +509,7 @@ def test_generate_build_tasks_to_build_files_from_filepaths(self):
 
         self.assertEqual(len(build_tasks), 0)
         build_tasks += build.generate_build_tasks_to_build_files_from_filepaths(
-            MOCK_ASSETS_DEV_DIR, MOCK_ASSETS_OUT_DIR, svg_filepaths,
-            asset_hashes)
+            MOCK_ASSETS_DEV_DIR, MOCK_ASSETS_OUT_DIR, svg_filepaths)
         self.assertEqual(len(build_tasks), len(svg_filepaths))
 
     def test_generate_build_tasks_to_build_directory(self):
@@ -562,31 +518,22 @@ def test_generate_build_tasks_to_build_directory(self):
         """
         EXTENSIONS_DIRNAMES_TO_DIRPATHS = {
             'dev_dir': MOCK_EXTENSIONS_DEV_DIR,
-            'compiled_js_dir': MOCK_EXTENSIONS_COMPILED_JS_DIR,
             'staging_dir': os.path.join(
                 TEST_DIR, 'backend_prod_files', 'extensions', ''),
             'out_dir': os.path.join(TEST_DIR, 'build', 'extensions', '')
         }
         file_hashes = build.get_file_hashes(MOCK_EXTENSIONS_DEV_DIR)
-        compiled_js_file_hashes = build.get_file_hashes(
-            MOCK_EXTENSIONS_COMPILED_JS_DIR)
         build_dir_tasks = collections.deque()
         build_all_files_tasks = (
             build.generate_build_tasks_to_build_all_files_in_directory(
                 MOCK_EXTENSIONS_DEV_DIR,
-                EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir'],
-                file_hashes))
-        build_all_files_tasks += (
-            build.generate_build_tasks_to_build_all_files_in_directory(
-                MOCK_EXTENSIONS_COMPILED_JS_DIR,
-                EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir'],
-                compiled_js_file_hashes))
+                EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir']))
         self.assertGreater(len(build_all_files_tasks), 0)
 
         # Test for building all files when staging dir does not exist.
         self.assertEqual(len(build_dir_tasks), 0)
         build_dir_tasks += build.generate_build_tasks_to_build_directory(
-            EXTENSIONS_DIRNAMES_TO_DIRPATHS, file_hashes)
+            EXTENSIONS_DIRNAMES_TO_DIRPATHS)
         self.assertEqual(len(build_dir_tasks), len(build_all_files_tasks))
 
         build.safe_delete_directory_tree(TEST_DIR)
@@ -597,10 +544,8 @@ def test_generate_build_tasks_to_build_directory(self):
             EXTENSIONS_DIRNAMES_TO_DIRPATHS['staging_dir'])
         self.assertEqual(len(build_dir_tasks), 0)
 
-        source_hashes = file_hashes
-        source_hashes.update(compiled_js_file_hashes)
         build_dir_tasks += build.generate_build_tasks_to_build_directory(
-            EXTENSIONS_DIRNAMES_TO_DIRPATHS, source_hashes)
+            EXTENSIONS_DIRNAMES_TO_DIRPATHS)
         self.assertEqual(len(build_dir_tasks), len(build_all_files_tasks))
 
         build.safe_delete_directory_tree(TEST_DIR)
@@ -620,7 +565,7 @@ def test_generate_build_tasks_to_build_directory(self):
         # Test for only building files that need to be rebuilt.
         self.assertEqual(len(build_dir_tasks), 0)
         build_dir_tasks += build.generate_build_tasks_to_build_directory(
-            EXTENSIONS_DIRNAMES_TO_DIRPATHS, build_dir_tasks)
+            EXTENSIONS_DIRNAMES_TO_DIRPATHS)
         file_extensions_to_always_rebuild = ('.html', '.py',)
         always_rebuilt_filepaths = build.get_filepaths_by_extensions(
             MOCK_EXTENSIONS_DEV_DIR, file_extensions_to_always_rebuild)
@@ -639,32 +584,22 @@ def test_re_build_recently_changed_files_at_dev_dir(self):
 
         EXTENSIONS_DIRNAMES_TO_DIRPATHS = {
             'dev_dir': MOCK_EXTENSIONS_DEV_DIR,
-            'compiled_js_dir': MOCK_EXTENSIONS_COMPILED_JS_DIR,
             'staging_dir': os.path.join(
                 TEST_DIR, 'backend_prod_files', 'extensions', ''),
             'out_dir': os.path.join(TEST_DIR, 'build', 'extensions', '')
         }
 
-        file_hashes = build.get_file_hashes(MOCK_EXTENSIONS_DEV_DIR)
-        compiled_js_file_hashes = build.get_file_hashes(
-            MOCK_EXTENSIONS_COMPILED_JS_DIR)
         build_dir_tasks = collections.deque()
         build_all_files_tasks = (
             build.generate_build_tasks_to_build_all_files_in_directory(
                 MOCK_EXTENSIONS_DEV_DIR,
-                EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir'],
-                file_hashes))
-        build_all_files_tasks += (
-            build.generate_build_tasks_to_build_all_files_in_directory(
-                MOCK_EXTENSIONS_COMPILED_JS_DIR,
-                EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir'],
-                compiled_js_file_hashes))
+                EXTENSIONS_DIRNAMES_TO_DIRPATHS['out_dir']))
         self.assertGreater(len(build_all_files_tasks), 0)
 
         # Test for building all files when staging dir does not exist.
         self.assertEqual(len(build_dir_tasks), 0)
         build_dir_tasks += build.generate_build_tasks_to_build_directory(
-            EXTENSIONS_DIRNAMES_TO_DIRPATHS, file_hashes)
+            EXTENSIONS_DIRNAMES_TO_DIRPATHS)
         self.assertEqual(len(build_dir_tasks), len(build_all_files_tasks))
 
         build.safe_delete_directory_tree(TEST_DIR)
@@ -676,7 +611,7 @@ def test_re_build_recently_changed_files_at_dev_dir(self):
         self.assertEqual(len(build_dir_tasks), 0)
 
         build_dir_tasks = build.generate_build_tasks_to_build_directory(
-            EXTENSIONS_DIRNAMES_TO_DIRPATHS, {})
+            EXTENSIONS_DIRNAMES_TO_DIRPATHS)
         file_extensions_to_always_rebuild = ('.py', '.js', '.html')
         always_rebuilt_filepaths = build.get_filepaths_by_extensions(
             MOCK_EXTENSIONS_DEV_DIR, file_extensions_to_always_rebuild)
@@ -688,8 +623,7 @@ def test_re_build_recently_changed_files_at_dev_dir(self):
 
         # Test that 'some_file.js' is not rebuilt, i.e it is built for the first
         # time.
-        self.assertEqual(
-            len(build_dir_tasks), len(always_rebuilt_filepaths) + 1)
+        self.assertEqual(len(build_dir_tasks), len(always_rebuilt_filepaths))
         self.assertIn('some_file.js', always_rebuilt_filepaths)
         self.assertNotIn('some_file.js', build_dir_tasks)
 
@@ -733,79 +667,6 @@ def test_generate_delete_tasks_to_remove_deleted_files(self):
         self.assertEqual(
             len(delete_tasks), build.get_file_count(MOCK_TEMPLATES_DEV_DIR))
 
-    def test_compiled_js_dir_validation(self):
-        """Test that build.COMPILED_JS_DIR is validated correctly with
-        outDir in build.TSCONFIG_FILEPATH.
-        """
-        build.require_compiled_js_dir_to_be_valid()
-
-        out_dir = ''
-        with python_utils.open_file(build.TSCONFIG_FILEPATH, 'r') as f:
-            config_data = json.load(f)
-            out_dir = os.path.join(config_data['compilerOptions']['outDir'], '')
-        # Escape the special characters, like '\', in the file paths.
-        # The '\' character is usually seem in Windows style path.
-        # https://docs.python.org/2/library/os.html#os.sep
-        # https://docs.python.org/2/library/re.html#regular-expression-syntax
-        error_message = ('COMPILED_JS_DIR: %s does not match the output '
-                         'directory in %s: %s' % (
-                             re.escape(MOCK_COMPILED_JS_DIR),
-                             re.escape(build.TSCONFIG_FILEPATH),
-                             re.escape(out_dir)))
-        with self.assertRaisesRegexp(
-            Exception, error_message), self.swap(
-                build, 'COMPILED_JS_DIR', MOCK_COMPILED_JS_DIR):
-            build.require_compiled_js_dir_to_be_valid()
-
-    def test_compiled_js_dir_is_deleted_before_compilation(self):
-        """Test that compiled_js_dir is deleted before a fresh compilation."""
-        def mock_check_call(unused_cmd):
-            pass
-        def mock_require_compiled_js_dir_to_be_valid():
-            pass
-
-        with self.swap(
-            build, 'COMPILED_JS_DIR', MOCK_COMPILED_JS_DIR), self.swap(
-                build, 'require_compiled_js_dir_to_be_valid',
-                mock_require_compiled_js_dir_to_be_valid):
-
-            if not os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR)):
-                os.mkdir(os.path.dirname(MOCK_COMPILED_JS_DIR))
-
-            with self.swap(subprocess, 'check_call', mock_check_call):
-                build.compile_typescript_files('.')
-                self.assertFalse(
-                    os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR)))
-
-    def test_compiled_js_dir_is_deleted_before_watch_mode_compilation(self):
-        """Test that compiled_js_dir is deleted before a fresh watch mode
-        compilation.
-        """
-        # pylint: disable=unused-argument
-        def mock_call(unused_cmd, shell, stdout):
-            pass
-        def mock_popen(unused_cmd, stdout):
-            pass
-        # pylint: enable=unused-argument
-        def mock_require_compiled_js_dir_to_be_valid():
-            pass
-
-        with self.swap(
-            build, 'COMPILED_JS_DIR', MOCK_COMPILED_JS_DIR), self.swap(
-                build, 'require_compiled_js_dir_to_be_valid',
-                mock_require_compiled_js_dir_to_be_valid):
-
-            if not os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR)):
-                os.mkdir(os.path.dirname(MOCK_COMPILED_JS_DIR))
-
-            with self.swap(subprocess, 'Popen', mock_popen), self.swap(
-                subprocess, 'call', mock_call), self.swap(
-                    build, 'TSC_OUTPUT_LOG_FILEPATH',
-                    MOCK_TSC_OUTPUT_LOG_FILEPATH):
-                build.compile_typescript_files_continuously('.')
-                self.assertFalse(
-                    os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR)))
-
     def test_generate_app_yaml(self):
         mock_dev_yaml_filepath = 'mock_app_dev.yaml'
         mock_yaml_filepath = 'mock_app.yaml'
@@ -891,13 +752,11 @@ def test_build_with_prod_env(self):
         check_function_calls = {
             'build_using_webpack_gets_called': False,
             'ensure_files_exist_gets_called': False,
-            'compile_typescript_files_gets_called': False,
             'compare_file_count_gets_called': False
         }
         expected_check_function_calls = {
             'build_using_webpack_gets_called': True,
             'ensure_files_exist_gets_called': True,
-            'compile_typescript_files_gets_called': True,
             'compare_file_count_gets_called': True
         }
 
@@ -907,9 +766,6 @@ def mock_build_using_webpack():
         def mock_ensure_files_exist(unused_filepaths):
             check_function_calls['ensure_files_exist_gets_called'] = True
 
-        def mock_compile_typescript_files(unused_project_dir):
-            check_function_calls['compile_typescript_files_gets_called'] = True
-
         def mock_compare_file_count(unused_first_dir, unused_second_dir):
             check_function_calls['compare_file_count_gets_called'] = True
 
@@ -917,13 +773,11 @@ def mock_compare_file_count(unused_first_dir, unused_second_dir):
             build, '_ensure_files_exist', mock_ensure_files_exist)
         build_using_webpack_swap = self.swap(
             build, 'build_using_webpack', mock_build_using_webpack)
-        compile_typescript_files_swap = self.swap(
-            build, 'compile_typescript_files', mock_compile_typescript_files)
         compare_file_count_swap = self.swap(
             build, '_compare_file_count', mock_compare_file_count)
 
         with ensure_files_exist_swap, build_using_webpack_swap, (
-            compile_typescript_files_swap), compare_file_count_swap:
+            compare_file_count_swap):
             build.main(args=['--prod_env'])
 
         self.assertEqual(check_function_calls, expected_check_function_calls)
@@ -931,58 +785,38 @@ def mock_compare_file_count(unused_first_dir, unused_second_dir):
     def test_build_with_watcher(self):
         check_function_calls = {
             'ensure_files_exist_gets_called': False,
-            'compile_typescript_files_continuously_gets_called': False
         }
         expected_check_function_calls = {
             'ensure_files_exist_gets_called': True,
-            'compile_typescript_files_continuously_gets_called': True
         }
 
         def mock_ensure_files_exist(unused_filepaths):
             check_function_calls['ensure_files_exist_gets_called'] = True
 
-        def mock_compile_typescript_files_continuously(unused_project_dir):
-            check_function_calls[
-                'compile_typescript_files_continuously_gets_called'] = True
-
         ensure_files_exist_swap = self.swap(
             build, '_ensure_files_exist', mock_ensure_files_exist)
-        compile_typescript_files_continuously_swap = self.swap(
-            build, 'compile_typescript_files_continuously',
-            mock_compile_typescript_files_continuously)
-
-        with ensure_files_exist_swap, (
-            compile_typescript_files_continuously_swap):
-            build.main(args=['--enable_watcher'])
+        with ensure_files_exist_swap:
+            build.main(args=[])
 
         self.assertEqual(check_function_calls, expected_check_function_calls)
 
     def test_cannot_minify_third_party_libs_in_dev_mode(self):
         check_function_calls = {
             'ensure_files_exist_gets_called': False,
-            'compile_typescript_files_gets_called': False
         }
         expected_check_function_calls = {
             'ensure_files_exist_gets_called': True,
-            'compile_typescript_files_gets_called': True
         }
 
         def mock_ensure_files_exist(unused_filepaths):
             check_function_calls['ensure_files_exist_gets_called'] = True
 
-        def mock_compile_typescript_files(unused_project_dir):
-            check_function_calls['compile_typescript_files_gets_called'] = True
-
         ensure_files_exist_swap = self.swap(
             build, '_ensure_files_exist', mock_ensure_files_exist)
-        compile_typescript_files_swap = self.swap(
-            build, 'compile_typescript_files', mock_compile_typescript_files)
         assert_raises_regexp_context_manager = self.assertRaisesRegexp(
             Exception,
             'minify_third_party_libs_only should not be set in non-prod mode.')
-
-        with ensure_files_exist_swap, compile_typescript_files_swap, (
-            assert_raises_regexp_context_manager):
+        with ensure_files_exist_swap, assert_raises_regexp_context_manager:
             build.main(args=['--minify_third_party_libs_only'])
 
         self.assertEqual(check_function_calls, expected_check_function_calls)