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

esbuild plugin doesn't build when src is specified #710

Open
ooker777 opened this issue Dec 29, 2024 · 1 comment
Open

esbuild plugin doesn't build when src is specified #710

ooker777 opened this issue Dec 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ooker777
Copy link
Contributor

ooker777 commented Dec 29, 2024

I have this config:

import lume from "lume/mod.ts";
import wiki from "wiki/mod.ts";
import esbuild from "lume/plugins/esbuild.ts";

const site = lume({
  src: "./docs",
});

site.use(esbuild({
  extensions: [".ts", ".js"],
  options: {
    plugins: [],
    bundle: true,
    format: "esm",
    minify: false,
    keepNames: true,
    platform: "browser",
    target: "esnext",
    entryPoints: ["./scripts/chart.ts"],
    outdir: "./",
    outbase: ".",
    charset: "utf8",
  },
}));
site.use(wiki());

export default site;

And this index.md in both / and /docs:

---
extra_head: <script src="./scripts/chart.js" type="module"></script>
---
<div id="main" style="width: 100%; height: 500px"></div>

When src: "./docs" is commented, then the bundled scripts exist in _site. But when it is uncommented, there is no bundled script.

Lume v2.4.3

@ooker777 ooker777 added the bug Something isn't working label Dec 29, 2024
@oscarotero
Copy link
Member

Are your scripts inside docs folder?
Note also that you don't need to specify entryPoints. Lume automatically bundle all ts and js files found in the src folder. You can simply run site.use(esbuild()) (without options) and it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants