hunk.code_window: import {join} from 'path';
   import {ng} from '../../../utils/process';
   import {expectFileToExist, createDir} from '../../../utils/fs';
   export default function() {
  
hunk.labels: keep keep replace keep keep keep
hunk.after_edit: import {expectFileToExist} from '../../../utils/fs';
  
hunk.file_path: tests/e2e/tests/generate/component/component-path-case.ts
hunk.type: replace
file: import * as path from 'path';
  import {AotPlugin} from '@ngtools/webpack';
  
  
  const g: any = global;
  const webpackLoader: string = g['angularCliIsLocal']
    ? g.angularCliPackages['@ngtools/webpack'].main
    : '@ngtools/webpack';
  
  
  export const getWebpackNonAotConfigPartial = function(projectRoot: string, appConfig: any) {
    let exclude = [ '**/*.spec.ts' ];
    if (appConfig.test) { exclude.push(path.join(projectRoot, appConfig.root, appConfig.test)); };
    return {
      module: {
        rules: [
          {
            test: /\.ts$/,
            loader: webpackLoader,
            exclude: [/\.(spec|e2e)\.ts$/]
          }
        ]
      },
      plugins: [
        new AotPlugin({
          tsConfigPath: path.resolve(projectRoot, appConfig.root, appConfig.tsconfig),
          mainPath: path.join(projectRoot, appConfig.root, appConfig.main),
          exclude: exclude,
          skipCodeGeneration: true
        }),
      ]
    };
  };
  
  export const getWebpackAotConfigPartial = function(projectRoot: string, appConfig: any,
    i18nFile: string, i18nFormat: string, locale: string) {
    let exclude = [ '**/*.spec.ts' ];
    if (appConfig.test) { exclude.push(path.join(projectRoot, appConfig.root, appConfig.test)); };
    return {
      module: {
        rules: [
          {
            test: /\.ts$/,
            loader: webpackLoader,
            exclude: [/\.(spec|e2e)\.ts$/]
          }
        ]
      },
      plugins: [
        new AotPlugin({
          tsConfigPath: path.resolve(projectRoot, appConfig.root, appConfig.tsconfig),
          mainPath: path.join(projectRoot, appConfig.root, appConfig.main),
          i18nFile: i18nFile,
          i18nFormat: i18nFormat,
          locale: locale,
          exclude: exclude
        })
      ]
    };
  };
  