-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the use of ES6 syntax #148
Comments
Because plop runs in nodejs and not in the browser, it relies on the capabilities of the node runtime. Currently, es modules are not supported in node directly. If you want to use them, you'll need something like |
@amwmedia Thanks for your fast answer. I thought the
I get
|
honestly, I've never tried to get this working. When I'm working in nodejs, I'm accustomed to using these types of conventions. If you're interested in digging deeper and figuring out how to allow plopfiles to work with either syntax, I'd certainly be open to changes within plop to accommodate. |
After a little debug and some tests, I found a solution: index.js
generetors.js
|
Cut new release for 0.24
If anyone else finds this in the future (2024 and beyond) and is wondering how the hell to get Plopfiles running properly, e.g.
For me the solution was to rename You can then use ESM imports (e.g. |
When I'm using
For the file
I get the error
And of course it works fine with
How can we use the ES6 syntax ? There is no doc about it, I think adding one could be useful.
I don't know if it's changing something but I'm using a
create-react-app
project, so I can't modify my babel config without ejecting...The text was updated successfully, but these errors were encountered: