create-figma-plugin icon indicating copy to clipboard operation
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

Open fwextensions opened this issue 7 months ago • 10 comments

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.)

fwextensions avatar Nov 02 '23 01:11 fwextensions