Skip to content

Custom transformers not working for referenced projects #1025

Closed
@adam-stanek

Description

@adam-stanek

Hi. I am trying to build a mono-repo project consisting from webpack demo application and separately published library. The library is defined as referenced typescript project (projectReferences: true).
In order to build the library correctly I need custom transformer (@zerollup/ts-transform-paths to transform paths). It seems to be ignored when building the library.

Expected Behaviour

Library code gets emitted while being properly transformed.

Actual Behaviour

Library code gets emitted but no transformation is applied. It is worth mentioning that @zerollup/ts-transform-paths run through ttypescript is working fine.

Steps to Reproduce the Problem

ts-loader options

{
  projectReferences: true,
  getCustomTransformers: require.resolve('./webpack.tsTransformers'),
}

./webpack.tsTransformers.js

const createTsTransformPath = require('@zerollup/ts-transform-paths')

function getCustomTransformers(program) {
  const tsTransformPath = createTsTransformPath(program)

  return {
    before: [tsTransformPath.before],
    // after: [tsTransformPath.afterDeclarations],
  }
}

module.exports = getCustomTransformers

Location of a Minimal Repository that Demonstrates the Issue.

adam-stanek/chobot@8bf5dd2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions