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

Update docs for --configPlugin using typescript #4495

Conversation

Jimmydalecleveland
Copy link
Contributor

@Jimmydalecleveland Jimmydalecleveland commented May 11, 2022

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

The documentation gives examples for using @rollup/plugin-typescript to parse the Rollup configuration file, with a CLI code example. However, that example will fail to build with a somewhat misleading error if the Rollup config is not declared in the tsconfig.json's include property, so a note about needing to do so has been added with this commit.

For an example of the error I'm referring to, here is what happened to me:

[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
rollup.config.ts (5:13)
3: import del from "rollup-plugin-delete";
4:
5: const options: RollupOptions = {
                ^
6:   input: "src/index.ts",
7:   output: [
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)

This is pretty obvious when you know the answer, but when you first get this error after following the docs, it is a bit confusing because it seems like something is wrong with your CLI flags or the config itself due to the error giving the same output as if the @rollup/plugin-typescript was not setup at all.

I'm happy to reword this, or move it somewhere else if anyone has suggestions.

The documentation gives examples for using `@rollup/plugin-typescript` to parse the Rollup configuration file, with a CLI code example. However, that example will fail to build with a somewhat misleading error if the Rollup config is not declared in the `tsconfig.json`'s `include` property, so a note about needing to do so has been added with this commit.
@lukastaegert lukastaegert enabled auto-merge (squash) May 13, 2022
@codecov
Copy link

@codecov codecov bot commented May 13, 2022

Codecov Report

Merging #4495 (bd5ca1a) into master (8c6e0f3) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4495   +/-   ##
=======================================
  Coverage   98.72%   98.72%           
=======================================
  Files         206      206           
  Lines        7351     7351           
  Branches     2086     2086           
=======================================
  Hits         7257     7257           
  Misses         34       34           
  Partials       60       60           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c6e0f3...bd5ca1a. Read the comment docs.

auto-merge was automatically disabled May 13, 2022

Head branch was pushed to by a user without write access

@lukastaegert lukastaegert enabled auto-merge (squash) May 13, 2022
@lukastaegert lukastaegert disabled auto-merge May 13, 2022
@lukastaegert lukastaegert merged commit bbd54b7 into rollup:master May 13, 2022
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants