# Get a CommonJS build: echo 'export * from "clipboard-polyfill" ' | npx esbuild -format=cjs -target=es6 -bundle Why clipboard-polyfill?īrowsers have implemented several clipboard APIs over time, and writing to the clipboard without triggering bugs in various old and current browsers is fairly tricky. Import * as clipboard from "clipboard-polyfill" async function handler ( ) from "clipboard-polyfill" ' | npx esbuild -format=esm -target=es6 -bundle -minifyĬat node_modules/clipboard-polyfill/dist/es5/window-var/5.js | npx esbuild -format=esm -target=es5 -bundle -minify For a tree-shaken text-only build, also see: Please import `writeText(…)` from `clipboard-polyfill` directly. The main build uses ESM with module splitting, so there is no longer a text-only build. We no longer publish minified and/or CommonJS builds. This should succeed in some environments where permissions are not consistently enforced. `writeText(…)` now tries more fallbacks even if the `(…)` API is available. Please let me know if if you encounter any compatibility issues. I've tested compatibility all the way back to IE10, and this will hopefully make the project more maintainable in the future. The build system has been overhauled to use `esbuild`. Thanks for filing issues documenting remaining use cases: I do not expect to add new features, and most modern projects will no longer need this library. `clipboard-polyfill` is entering maintenance mode.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |