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

Unable to use .glob option #94

Open
diode opened this issue Jul 28, 2022 · 1 comment
Open

Unable to use .glob option #94

diode opened this issue Jul 28, 2022 · 1 comment

Comments

@diode
Copy link

diode commented Jul 28, 2022

As per docs :

sveld({
  input: "./src/index.js",
  glob: true,
  markdown: true,
  markdownOptions: {
    onAppend: (type, document, components) => {
      if (type === "h1")
        document.append("quote", `${components.size} components exported from ${pkg.name}@${pkg.version}.`);
    },
  },
  json: true,
  jsonOptions: {
    outFile: "docs/src/COMPONENT_API.json",
  },
});

But

const entry = fs.readFileSync(input, "utf-8");

  const dir = fs.lstatSync(input).isFile() ? path.dirname(input) : input;
  const entry = fs.readFileSync(input, "utf-8");

throws error as fs.readFileSync fails on a directory

@metonym
Copy link
Collaborator

metonym commented Jul 28, 2022

Thanks for reporting.

As a workaround, are you able to omit the input property and have the Svelte entry be inferred from the package.json?

See the build script used by carbon-components-svelte.

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

No branches or pull requests

2 participants