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

Load plugins in browser environment #826

Open
roman-sainchuk opened this issue Aug 23, 2022 · 0 comments
Open

Load plugins in browser environment #826

roman-sainchuk opened this issue Aug 23, 2022 · 0 comments

Comments

@roman-sainchuk
Copy link
Contributor

Describe the bug

Currently plugins don't work in browser env.

To Reproduce
Steps to reproduce the behavior:

import { createConfig, makeDocumentFromString } from '@redocly/openapi-core';

const openapi = `
  openapi: "3.0.0"
  info:
    version: 1.0.0
    title: Swagger Petstore
`;

const document = makeDocumentFromString(openapi, '/some-path');

const config = await createConfig(`
  lint:
    plugins:
      - './local-plugin.js'
  extends:
    - recommended
`);

const problems = await lintDocument({
  document,
  config: config.styleguide,
});
  1. See error
    Cannot load ./local-plugin.js. Plugins aren't supported in browser yet.

Expected behavior

Plugin should be loaded and ran

Redocly Version(s)

v1.0.0-beta.108

Additional context

Browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants