<commit_before>/*jslint node: true */
'use strict';

function getWebpackConfig(skyPagesConfig) {
  function spaPath() {
    return skyPagesConfigUtil.spaPath.apply(skyPagesConfigUtil, arguments);
  }

  function outPath() {
    return skyPagesConfigUtil.outPath.apply(skyPagesConfigUtil, arguments);
  }

  const path = require('path');

  const DefinePlugin = require('webpack/lib/DefinePlugin');
  const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
  const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
  const skyPagesConfigUtil = require('../sky-pages/sky-pages.config');
  const aliasBuilder = require('./alias-builder');

  skyPagesConfig.runtime.includeRouteModule = false;

  const ENV = process.env.ENV = process.env.NODE_ENV = 'test';
  const srcPath = path.resolve(process.cwd(), 'src', 'app');
  const moduleLoader = outPath('loader', 'sky-pages-module');

  const resolves = [
    process.cwd(),
    spaPath('node_modules'),
    outPath('node_modules')
  ];

  const excludes = [
    spaPath('node_modules'),
    outPath('node_modules')
  ];

  let alias = aliasBuilder.buildAliasList(skyPagesConfig);

  return {
    devtool: 'inline-source-map',

    resolveLoader: {
      modules: resolves
    },

    resolve: {
      alias: alias,
      modules: resolves,
      extensions: [
        '.js',
        '.ts'
      ],
    },

    module: {
      rules: [
        {
          enforce: 'pre',
          test: /runtime\/config\.ts$/,
          loader: outPath('loader', 'sky-app-config')
        },
        {
          enforce: 'pre',
          test: /sky-pages\.module\.ts$/,
          loader: moduleLoader
        },
        {
          enforce: 'pre',
          test: /\.ts$/,
          loader: 'tslint-loader',
          exclude: excludes
        },
        {
          enforce: 'pre',
          test: /\.js$/,
          loader: 'source-map-loader',
          exclude: excludes
        },
        {
          enforce: 'pre',
          loader: outPath('loader', 'sky-processor', 'preload'),
          exclude: /node_modules/
        },
        {
          test: /\.ts$/,
          use: [
            {
              loader: 'awesome-typescript-loader',
              options: {
                // Ignore the "Cannot find module" error that occurs when referencing<commit_msg>TSLint errors abort the build (#139)<commit_after>/*jslint node: true */
'use strict';

function getWebpackConfig(skyPagesConfig) {
  function spaPath() {
    return skyPagesConfigUtil.spaPath.apply(skyPagesConfigUtil, arguments);
  }

  function outPath() {
    return skyPagesConfigUtil.outPath.apply(skyPagesConfigUtil, arguments);
  }

  const path = require('path');

  const DefinePlugin = require('webpack/lib/DefinePlugin');
  const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
  const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
  const skyPagesConfigUtil = require('../sky-pages/sky-pages.config');
  const aliasBuilder = require('./alias-builder');

  skyPagesConfig.runtime.includeRouteModule = false;

  const ENV = process.env.ENV = process.env.NODE_ENV = 'test';
  const srcPath = path.resolve(process.cwd(), 'src', 'app');
  const moduleLoader = outPath('loader', 'sky-pages-module');

  const resolves = [
    process.cwd(),
    spaPath('node_modules'),
    outPath('node_modules')
  ];

  const excludes = [
    spaPath('node_modules'),
    outPath('node_modules')
  ];

  let alias = aliasBuilder.buildAliasList(skyPagesConfig);

  return {
    devtool: 'inline-source-map',

    resolveLoader: {
      modules: resolves
    },

    resolve: {
      alias: alias,
      modules: resolves,
      extensions: [
        '.js',
        '.ts'
      ],
    },

    module: {
      rules: [
        {
          enforce: 'pre',
          test: /runtime\/config\.ts$/,
          loader: outPath('loader', 'sky-app-config')
        },
        {
          enforce: 'pre',
          test: /sky-pages\.module\.ts$/,
          loader: moduleLoader
        },
        {
          enforce: 'pre',
          test: /\.ts$/,
          loader: 'tslint-loader',
          exclude: excludes,
          options: {
            emitErrors: true,
            failOnHint: true
          }
        },
        {
          enforce: 'pre',
          test: /\.js$/,
          loader: 'source-map-loader',
          exclude: excludes
        },
        {
          enforce: 'pre',
          loader: outPath('loader', 'sky-processor', 'preload'),
          exclude: /node_modules/
        },
        {
          test: /\.ts$/,
          use: [
            {
              loader: 'awesome-typescript-loader',
              options: {
                // Ignore the "Cannot find module" error that occurs when referencing
{'fraction_non_alphanumeric': 0.13797415589829096, 'fraction_numerical': 0.0006252605252188412, 'mean_word_length': 2.0981278244028405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4922557', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1377, 'n_words': 275}