Skip to content

ts-loader's default config makes Webpack extremely slow in larger projects #91

Description

@vilanz

The nature of ts-loader makes it slower as the project's size increases.
https://github.com/TypeStrong/ts-loader#faster-builds

There are 2 options to make it fast:

  • Use a separate process for typechecking, following ts-loader's docs in the link above:
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
[ ... ]
  module: {
    rules: [{
        test: /\.ts$/,
        loaders: [{
          loader: 'ts-loader',
          options: {
              transpileOnly: true
          }
        }, 'angular2-template-loader']
      },
[ ... ].
  plugins: [
    new ForkTsCheckerWebpackPlugin(),
[ ... ]
  • Use awesome-typescript-loader:
[ ... ]
  module: {
    rules: [{
        test: /\.ts$/,
        loaders: ['awesome-typescript-loader', 'angular2-template-loader']
      },
[ ... ]

Any inputs on if these changes breaks anything?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions