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

unbuild transform docs not up to date? #502

Open
OrbisK opened this issue Feb 27, 2025 · 0 comments
Open

unbuild transform docs not up to date? #502

OrbisK opened this issue Feb 27, 2025 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@OrbisK
Copy link

OrbisK commented Feb 27, 2025

📚 Is your documentation request related to a problem?

the build.config.ts form https://regexp.dev/guide has some typeerrors.

import { MagicRegExpTransformPlugin } from 'magic-regexp/transform'
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
  entries: ['./index.ts'],
  declaration: true,
  hooks: {
    'rollup:options': (options, config) => {
      config.plugins.push(MagicRegExpTransformPlugin.rollup())
    },
  },
})

ERROR:

build.config.ts:9:7 - error TS18049: 'config.plugins' is possibly 'null' or 'undefined'.

9       config.plugins.push(MagicRegExpTransformPlugin.rollup())
        ~~~~~~~~~~~~~~

build.config.ts:9:22 - error TS2339: Property 'push' does not exist on type 'false | Plugin<any> | InputPluginOption[] | Promise<false | Plugin<any> | NullValue | InputPluginOption[]>'.
  Property 'push' does not exist on type 'false'.

9       config.plugins.push(MagicRegExpTransformPlugin.rollup())

🔍 Where should you find it?

No response

ℹ️ Additional context

No response

@OrbisK OrbisK added the documentation Improvements or additions to documentation label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants