create-figma-plugin
create-figma-plugin copied to clipboard
Building with 3.0.2 fails on Windows if there's a `build-figma-plugin.ui.cjs` file in the repo
I think this is #77 all over again. The build-figma-plugin.ui.cjs
file is just this:
module.exports = (buildOptions) => ({
...buildOptions,
keepNames: true,
});
When it's in the main directory, npm run build
fails with this error:
info Typechecking...
success Typechecked in 2.048s
info Building...
error esbuild error
Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: [email protected]
npm ERR! at location: C:\...\test
When the config file is removed, the build works, but the plugin doesn't, because it needs to pass keepNames: true
to esbuild. (As an aside, it would be nice if this sort of config, as well as the manifest, could be passed on the command line, which would then avoid this problem.)