TypeError: esbuild is not a function
See original GitHub issueWhen using the latest rollup version and latest rollup-plugin-esbuild version, I get the following error when running rollup:
TypeError: esbuild is not a function
my rollup config looks like this:
import json from "@rollup/plugin-json";
import dts from "rollup-plugin-dts";
import esbuild from "rollup-plugin-esbuild";
import pkg from "./package.json";
export default [
{
input: "src/lib/index.ts",
plugins: [
esbuild({
// All options are optional
include: "src/lib/",
minify: process.env.NODE_ENV === "production",
tsconfig: "tsconfig.lib.json",
}),
json(),
],
output: [
{ file: pkg.main, format: "cjs" },
{ file: pkg.module, format: "es" },
],
},
{
input: "src/lib/index.ts",
output: [{ file: pkg.types, format: "es" }],
plugins: [dts()],
},
];
Issue Analytics
- State:
- Created 10 months ago
- Comments:5
Top Results From Across the Web
Copy plugin for esbuild "is not a function" - Stack Overflow
The problem was, that the DOM contained another element named copy that was not a function. Even though I'm not in a Browser...
Read more >esbuild is not a function · Issue #23 · unjs/unbuild - GitHub
If you generate a new repository using unbuild, and some parts of your build relies on rollup, you get a TypeError breaking the...
Read more >FAQ - ESBuild
While esbuild is busy parsing your JavaScript, node is busy parsing your bundler's JavaScript. By the time node has finished parsing your bundler's...
Read more >Uncaught TypeError: util.inherits is not a function
Uncaught TypeError: util.inherits is not a function · npm install --save-dev @esbuild-plugins/node-globals-polyfill · npm install --save-dev @ ...
Read more >rollup-plugin-esbuild - npm
You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).**.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://stackblitz.com/edit/node-gcuwxg?file=rollup.config.mjs I did some fixes to your project (some missing deps + some chores) Now it seems to work without issues.
Let me know if you have any question 😃
Modified the packaging command build, and introduced the imported package.json through other methods😁😁😁There is even a way to create require, learned✨