-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
attempting to use the plugin as suggested in the readme:
Lines 19 to 33 in b50ec18
| ## Usage | |
| ```js | |
| import { build } from "esbuild"; | |
| import { copyPlugin } from "@sprout2000/esbuild-copy-plugin"; | |
| build({ | |
| plugins: [ | |
| copyPlugin({ | |
| src: "./assets/icon.png", | |
| dest: "./dist/logo.png", | |
| }), | |
| ], | |
| }); | |
| ``` |
does not work. attempting to run the esbuild script results in this error:
import { copyPlugin } from "@sprout2000/esbuild-copy-plugin";
^^^^^^^^^^
SyntaxError: Named export 'copyPlugin' not found. The requested module '@sprout2000/esbuild-copy-plugin' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@sprout2000/esbuild-copy-plugin';
const { copyPlugin } = pkg;
it seems that the workaround suggested by the error message is the only way @sprout2000/esbuild-copy-plugin is imported, from all instances of its usage I can find on github
Metadata
Metadata
Assignees
Labels
No labels