Skip to content

Webpack cache-loader interferes with ts-loader #69

Closed
@b-zurg

Description

@b-zurg

I'm not sure if this is something appropriate for here but I noticed something interesting. While using this recommendation from the readme:

const typescriptIsTransformer = require('typescript-is/lib/transform-inline/transformer').default

module.exports = {
    // I am hiding the rest of the webpack config
    module: {
        rules: [
            {
                test: /\.ts$/,
                exclude: /node_modules/,
                loader: 'ts-loader',
                options: {
                    getCustomTransformers: program => ({
                        before: [typescriptIsTransformer(program)]
                    })
                }
            }
        ]
    }
};

I noticed that it only works when I don't use cache-loader in this rule. (e.g. rules: ['cache-loader', { loader: 'ts-loader', ...}
I believe the same goes for using ttypescript.

If this is a known then it might be good to mention it on the readme as that could save others time. But I'm a bit baffled by this.

Any insight?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions