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

fix: fix typo in postcssPlugin #764

Merged
merged 1 commit into from
Nov 14, 2022
Merged

fix: fix typo in postcssPlugin #764

merged 1 commit into from
Nov 14, 2022

Commits on Nov 6, 2022

  1. fix typo in postcssPlugin

    When building with tsup I have configured esbuild to use the new [`copy` loader](https://esbuild.github.io/content-types/#copy) for CSS files:
    ```
    const { build } = require('tsup');
    build({
      // ...
      loader: {
      	'.css': 'copy'
      },
    });
    ```
    
    Unfortunately this is causing an error when building due to an old version of `postcss` I have in my dependency tree:
    ```
    ✘ [ERROR] [plugin postcss] postcss.default is not a function
    
        ../../utilities/module-scripts/node_modules/tsup/dist/index.js:1348:74:
          1348 │           const result = await (postcss == null ? void 0 : postcss.default(plugins).process(contents, { ...options, from: args.path }));
    ```
    I was trying to figure out why tsup was trying to invoke postcss at all, and discovered what looks like a typo, which causes invocation of postcss even if there is no postcss config present.
    
    One thing I am not sure about: I feel like given my config we should not be including the esbuild `postcssPlugin` at all? So maybe this should also be fixed at a higher level? But this was sufficient to avoid the error.
    gavinsharp authored Nov 6, 2022
    Configuration menu
    Copy the full SHA
    654571f View commit details
    Browse the repository at this point in the history