jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.28k stars 507 forks source link

`tsdx.config.js` Rollup doesn't run on `tsdx test` #708

Closed ildar-icoosoft closed 4 years ago

ildar-icoosoft commented 4 years ago

Current Behavior

  1. I created a react + storybook project.
  2. npm i rollup-plugin-react-svg --save-dev
  3. I created tsdx.config.js in the root directory with the following contents:
const reactSvg = require('rollup-plugin-react-svg');

module.exports = {
  rollup(config, options) {
    config.plugins.push(
      reactSvg({
        // svgo options
        svgo: {
          plugins: [], // passed to svgo
          multipass: true
        },

        // whether to output jsx
        jsx: false,

        // include: string
        include: null,

        // exclude: string
        exclude: null
      })
    );
    return config;
  },
};
  1. npm run test
  2. And nothing is changed. SVG still not working. It looks like rollup() function is not called. I tried to add broken code to rollup() function and there is no errors in console.

Expected behavior

I need to add rollup plugin

Your environment

Software Version(s)
TSDX ^0.13.2
TypeScript ^3.8.3
Browser Chrome
npm/Yarn npm 6.12.0
Node 12.13.0
Operating System Win 10
agilgur5 commented 4 years ago

npm run test

tsdx test doesn't run tsdx build and therefore doesn't run Rollup. tsdx test runs Jest.

tsdx.config.js most certainly works, there are even integration tests for it. There are also plenty of working references to tsdx.config.js, including the HOWTOs, which is a pinned issue.


@ildar-icoosoft you've made two issues that duplicate existing ones (one of which has like 9 duplicates already) and now this in short succession. That's not a good pattern I'm seeing from you so I feel like I have to very explicitly say this: Please recognize that issues aren't a support forum (including TSDX's issues) and most open-source maintainers are unpaid volunteers (including me), so please make sure to thoroughly check things on your side before reporting issues to open-source libraries. That means reading the docs, trying different options, and searching the issues and not resorting to reporting a new thing until you've done so.