[node-plop] Can't use node-plop inside vscode extension
Hi 👋🏼
I'm trying to do a vscode-extension which generate components based on a plopfile.js that I usefor a plop CLI.
As it is mandatory to do it programmatically, I use node-plop but each time I test the extension I get the following error:
require() of ES Module from not supported. Instead change the require of index.js in... to a dynamic import() which is available in all CommonJS modules. with the path pointing to node-plop.
I did some research about it & it looks like as VSCode is based on electron & they don't support ESM package only. https://github.com/microsoft/vscode/issues/130367
Maybe I'm missing something out of the box and would be glad to have your thought on it 🙏🏼
@Stun3R have you figured a solution to this?
@amwmedia would it be possible to know if there a version of node-plop that is CommonJS module and can be used in VSCode extension.
@ashish-gawali-adi do not tag individual maintainers.
There is no node-plop CJS release.
Sorry for that.
Thank you for the answer.
jumping on this thread, I am having the issue and it's works fine for 0.26.1 but for any version above I got the same error. Is there any manage change that went in from 0.26.* to the current version 0.32.*?
Nop, I didn't fixed it as there is no CJS release. But it might be good to have one I assume