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

tsdx-sass -- @rollup/plugin-image doesn't work in tsdx.config.js #628

Closed
tsukhu opened this issue Mar 19, 2020 · 5 comments
Closed

tsdx-sass -- @rollup/plugin-image doesn't work in tsdx.config.js #628

tsukhu opened this issue Mar 19, 2020 · 5 comments
Labels
kind: support Asking for support with something or a specific use case problem: removed issue template OP removed the issue template without good cause scope: integration Related to an integration, not necessarily to core (but could influence core) solution: duplicate This issue or pull request already exists solution: invalid This doesn't seem right solution: outdated This is not up-to-date with the current version

Comments

@tsukhu
Copy link

tsukhu commented Mar 19, 2020

MAINTAINER EDIT: tl;dr OP didn't fill out issue template and was apparently using tsdx-sass, which is a pretty outdated fork, and not tsdx. tsdx-sass predates tsdx.config.js (the fork is unnecessary with tsdx.config.js), so it wasn't being "picked up" because wrong package and outdated version.


Hi,
First of all congrats making this great tool. It worked perfectly.
I am using a Windows 10 laptop and the latest tsdx 0.12.3 based template. I was wanting to add support for image files and created this file (tsdx.config.js) in the root folder

const images = require('@rollup/plugin-image');

module.exports = {
  rollup(config, options) {
    config.plugins.push(images());

    return config;
  },
};

However it does not seem to be getting picked up when I run tsdx build.

  • Am I missing some configuration ?
  • How can I check if this config file is picked up (as there are no console logs for the same )

Thanks

@agilgur5
Copy link
Collaborator

tsdx.config.js in root dir is definitely picked up, we even recently added multiple tests around it. Should be able to console.log in there too, I've done it while testing.

Your issue is probably that @rollup/plugin-image seems to depend on plugin order, i.e. being one of the first plugins. You can use unshift instead of push or follow the HOWTO on this: #379 (comment)

Please search through issues before filing one, there are multiple duplicates for @rollup/plugin-image

@agilgur5 agilgur5 added the solution: duplicate This issue or pull request already exists label Mar 19, 2020
@agilgur5 agilgur5 changed the title tsdx.config.js not being picked up @rollup/plugin-image doesn't work in tsdx.config.js Mar 19, 2020
@agilgur5 agilgur5 added the scope: integration Related to an integration, not necessarily to core (but could influence core) label Mar 19, 2020
@tsukhu
Copy link
Author

tsukhu commented Mar 20, 2020

@agilgur5 I actually looked at all the issues before filing. Also added console logs but nothing appears. In fact even if I used and incorrect syntax in the tsdx.config.js file it did not cause any failure, so I am suspecting that the tsdx.config.js file is not being picked up. I'll again try out today, but if you could point me to a sample tsdx repo with a rollup extension that will be great

@agilgur5
Copy link
Collaborator

Ok. Those issues do point to plugin order mattering, but you didn't configure like those issues. If your tsdx.config.js isn't being executed then maybe it's in the wrong place.

I linked to two PRs that have passing tests with tsdx.config.js above. You can view the files of one of the integration tests here.

Other than passing end-to-end and integration tests on a CI matrix for Ubuntu, macOS, and Windows on multiple Node versions, there are also many users of tsdx.config.js, and most of the HOWTOs are around it, so it definitely works.

I don't know why yours doesn't work and you also didn't provide a reproduction, so I can't really help you out. You'll need to provide a minimal repro and I think creating one would help you figure out what's going on too.

@agilgur5 agilgur5 added the kind: support Asking for support with something or a specific use case label Mar 20, 2020
@tsukhu
Copy link
Author

tsukhu commented Mar 20, 2020

@agilgur5 Thank you so much for your response. I'll get back to you after trying out these

@tsukhu
Copy link
Author

tsukhu commented Mar 20, 2020

@agilgur5 found the issue .. My bad I used tsdx-sass for sass support (instead of adding a rollup config extension) .. This is based on an old version of tsdx and used overriding the tsdx functionality and hence the tsdx.config.js is not being picked up .. Thanks a lot

@agilgur5 agilgur5 changed the title @rollup/plugin-image doesn't work in tsdx.config.js tsdx-sass -- @rollup/plugin-image doesn't work in tsdx.config.js Apr 3, 2020
@agilgur5 agilgur5 added solution: invalid This doesn't seem right solution: outdated This is not up-to-date with the current version labels Apr 3, 2020
Repository owner locked and limited conversation to collaborators Apr 3, 2020
@agilgur5 agilgur5 added the problem: removed issue template OP removed the issue template without good cause label Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case problem: removed issue template OP removed the issue template without good cause scope: integration Related to an integration, not necessarily to core (but could influence core) solution: duplicate This issue or pull request already exists solution: invalid This doesn't seem right solution: outdated This is not up-to-date with the current version
Projects
None yet
Development

No branches or pull requests

2 participants