Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom transformer does not run when cache exists #155

Closed
WanderWang opened this issue Jun 19, 2019 · 6 comments
Closed

custom transformer does not run when cache exists #155

WanderWang opened this issue Jun 19, 2019 · 6 comments
Labels
kind: bug Something isn't working properly problem: needs more info This issue needs more information in order to handle it problem: removed issue template OP removed the issue template without good cause problem: stale Issue has not been responded to in some time scope: cache Related to the cache solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue

Comments

@WanderWang
Copy link

WanderWang commented Jun 19, 2019

What happens and why it is wrong

customTransformer does not works then rpt2_cache folder exists

Environment

Windows10 1903 ,WSL Terminal ( Ubuntu )

Versions

  • typescript:3.4.3
  • rollup:1.15.6
  • rollup-plugin-typescript2:0.21.1

rollup.config.js

  const inputOptions = {
        input: './index.ts',
        external: [

        ],
        plugins: [
            nodeResolve(),
            typescript({
                transformers,
                tsconfigDefaults,
                tsconfig: "tsconfig.json",
                tsconfigOverride: {
                    compilerOptions: {
                        module: 'esnext',
                        declarationDir: "../../../dist/" + packageName + "/dts-temp/"
                    }
                },
                useTsconfigDeclarationDir: true
            }),

        ]
    };
    const outputOptions = {
        file: path.join("../../../dist/", packageName, packageName + ".js"),
        format: "es",

    };

    // create a bundle
    const originCwdDir = process.cwd();
    process.chdir(path.resolve(__dirname, '../packages/', packageName, 'src'))
    const bundle = await rollup.rollup(inputOptions);

tsconfig.json

package.json

plugin output with verbosity 3

@WanderWang
Copy link
Author

by the way , set { clean:true } in rollup-plugin-typescript2 can resolve this program

@ezolenko
Copy link
Owner

Doesn't work how? Could you make a small test repo with reproduction?

@WanderWang
Copy link
Author

WanderWang commented Jun 27, 2019

Steps:

  1. Compile with rollup/rollup-plugin-typescript2

  2. After compilation, a cache file is generated

  3. Modify the compilation script and add transformer

  4. Compile without changing any typescript files

  5. CustomTransformer will not executed

I think it should be the caching mechanism of rollup itself because transformer has no executed without any changes to typescript source code

@ezolenko
Copy link
Owner

I see, might be because object-hash doesn't like the way you do transformers. Could you post what your transformers object looks like? Does it have async functions for example?

If possible, run the build with verbosity: 4 and post rpt2: plugin options: part of the output (printed close to the start of output).

Do you add a new transformer to a list of existing transformers or did you add a first transformer when there was none before? (that last part should work)

@ezolenko
Copy link
Owner

And yeah workaround is to do clean builds

@ezolenko ezolenko added kind: bug Something isn't working properly problem: needs more info This issue needs more information in order to handle it labels Jun 28, 2019
@agilgur5 agilgur5 added solution: workaround available There is a workaround available for this issue problem: removed issue template OP removed the issue template without good cause scope: cache Related to the cache labels May 8, 2022
@agilgur5 agilgur5 changed the title customTransformer does not works then rpt2_cache folder exists custom transformer does not run when cache exists May 8, 2022
@agilgur5 agilgur5 added the problem: stale Issue has not been responded to in some time label May 8, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented May 8, 2022

Closing this as a duplicate of #228 which has had much more activity and OP there responded to requests for more info, while this has been stale for some time.

@agilgur5 agilgur5 closed this as completed May 8, 2022
@agilgur5 agilgur5 added the solution: duplicate This issue or pull request already exists label May 8, 2022
Repository owner locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: bug Something isn't working properly problem: needs more info This issue needs more information in order to handle it problem: removed issue template OP removed the issue template without good cause problem: stale Issue has not been responded to in some time scope: cache Related to the cache solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

3 participants