Skip to content

Custom transformers not working for referenced projects #1025

Closed

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

Activity

  1. stale commented on Dec 19, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. stale commented on Dec 26, 2019

    @stale

    Closing as stale. Please reopen if you'd like to work on this further.

  3. unstubbable commented on Feb 18, 2021

    @unstubbable

    This is also true for typescript-plugin-styled-components, which is mentioned in the REAMDE as an example for getCustomTransformers. I'd like this issue to be reopened.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions