question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
tsukhucommented, 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

1reaction
agilgur5commented, Mar 20, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Imports path issue when using TSDX with preservedModules ...
So i added some configs to my tsdx.config.js and now it looks like this: ... require('cssnano') const babel = require('rollup-plugin-babel') ...
Read more >
Customization - TSDX
However, if you do wish to alter the rollup configuration, you can do so by creating a file called tsdx.config.js at the root...
Read more >
Bundle Stylesheets and Add LiveReload With Rollup
Learn how to use the JavaScript bundler Rollup to process stylesheets using PostCSS and rebuild & reload files when changes are made in...
Read more >
How to Build A React TS Tailwind Design System
Now we'll create a tsdx.config.js file in the root and in it, we'll put the following code: // tsdx.config.
Read more >
Build a component library with React and TypeScript
Now that Rollup and its awesome plugins are installed, let's move on to its configuration. Create a rollup.config.js file in the root of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found