We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FormField
"use client"
treeshake: false
Module level directives cause errors when bundled
import fs from "fs/promises"; import { Plugin } from "esbuild"; interface ESBuildUseClientOptions { filter?: RegExp; } export const esbuildUseClient = ({ filter = /\.client\.tsx$/, }: ESBuildUseClientOptions = {}): Plugin => ({ name: "use-client", setup(build): void { build.onLoad({ filter }, async (args) => { const source = await fs.readFile(args.path, "utf8"); const loader = args.path.endsWith(".tsx") ? "tsx" : "ts"; const data = await build.esbuild.transform(source, { loader, banner: '"use client";', }); return { warnings: data.warnings, contents: data.code + `//# sourceMappingURL=${data.map}`, }; }); }, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
"use client"
in TS files are removed by esbuild.treeshake: false
option enabled,Module level directives cause errors when bundled
warning is thrown by Rollup.The text was updated successfully, but these errors were encountered: