8000 Compilation significantly slower than TSC, and massive regression in 1.2.2? · Issue #393 · TypeStrong/ts-loader · GitHub
[go: up one dir, main page]

Skip to content
Compilation significantly slower than TSC, and massive regression in 1.2.2? #393
@prencher

Description

@prencher

With TypeScript 2.0.10's TSC, our compilation takes around 30 seconds, with an incremental time around 13 seconds, using the following configuration, and outputting individual files with source maps:

{
    "compilerOptions": {
        "experimentalDecorators": true,
        "forceConsistentCasingInFileNames": true,
        "isolatedModules": true,
        "jsx": "react",
        "lib": ["dom", "es2016"],
        "module": "commonjs",
        "moduleResolution": "node",
        "noImplicitAny": true,
        "sourceMap": true,
        "suppressImplicitAnyIndexErrors": true,
        "target": "es5",
        "typeRoots": [
            "./node_modules/@types",
            "./typings"
        ]
    },
    "exclude": [
        "node_modules"
    ]
}

However, when using ts-loader, the build takes around 70(!) seconds, with incrementals anywhere from 20-30 seconds.

That's bad enough, but with 1.2.2, it now takes around 98 seconds for both the initial compilation, and the incremental.

For reference, here's webpack configuration:

const webpack = require('webpack');
const packageJson = require('./package.json');

module.exports = {
    entry: {
        app: './source/main.ts',
        vendor: Object.keys(packageJson['dependencies']),
    },
    output: {
        path: 'build',
        filename: '[name].js'
    },
    devtool: 'source-map',
    resolve: {
        extensions: ['', '.js', '.ts', '.tsx', '.webpack.js', '.web.js'],
    },
    module: {
        loaders: [
            { loader: 'json-loader', test: /\.json$/ },
            { loader: 'ts-loader', test: /\.tsx?$/, exclude: /node_modules/ },
        ]
    },
    plugins: [
        new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
    ],
};

This is on Windows 10 using Node.js 6.9.1 and webpack 1.13.3.

Any idea? I've been completely unable to determine why.

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

      0