-
Notifications
You must be signed in to change notification settings - Fork 43
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
Is there a option to use import/export syntax? #147
Comments
@entropin FYI if you haven't found it already you can set Vite 3 to use common js for ssr with the I had the same issue myself upgrading from Vite 2 and settled on this for now. You could also set rollup options format to use commonjs ( |
Apologies for the slow response. I've added support for Word of caution - use of I will be releasing a version of the library with the addition some time this week. Edit: crashing is not an issue if you are consuming this library as a Nuget package. See #151 (comment). |
@JeremyTCD Can you post an example consuming an npm package inside .mjs file? I am trying to get it working and am seeing the following error:
package.json:
interop.js:
driver.cs:
|
Hi I have built some javascript using vue and Vite (ES modules), I'm trying to use Javascript.NodeJs to run the server-side rendering part of the javascript on our IIS Server.
cmd Node handles the file just fine, also using c# and Process Start() and pointing Node to the file path works. I just need to add a package.json and specifically enable modules. But I can't find a way to run the script using this lib. Is there a way?
Am about to give up, but found this comment:
"ES6 modules (import/export syntax) are experimental in the latest Node.js version (v14.4.0): nodejs.org/api/esm.html. To enable it, you can pass special arguments to Node.js or add an element to your package.json - refer to the Node.js docs enabling section for details. Documentation on passing arguments to Node.js through Jering.Javascript.Nodejs: github.com/JeringTech/Javascript.NodeJS#nodejsprocessoptions."
But I can't see a way to run it, we are using Node 18, can this script be run without having to use Bable to transpile? Any pointers?
The text was updated successfully, but these errors were encountered: