You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eventually the library should be transitioned from CommonJS style require statements like:
constpath=require('path')
..into ES Module style using import, which is the new standard.
importpathfrom'path'
Luckily, since the Roller library is used only as a command-line tool and not meant to be imported as a module, this change shouldn't affect users of the library with projects that are still on CommonJS.
The change also involves replacing module.exports with export statements.
@nicolas-jaussaud I wanted to let you know about this change in advance, just in case it might have unintended effects. In the JS ecosystem the transition has been a bit rough, as some popular libraries converted too early and broke compatibility. It should be fine in our case though.
I was reminded of this when you mentioned tangible.config.js starting with:
module.exports={ ... }
Gradually, I'd like to convert projects (plugins, etc.) to use ES Module style imports. This can be enabled in package.json with a single line:
"type": "module",
And changing the config file to export like this:
exportdefault{ ... }
This is already supported in the current version of Roller, as it uses await import() to load the config file instead of require().
The text was updated successfully, but these errors were encountered:
Eventually the library should be transitioned from CommonJS style
require
statements like:..into ES Module style using
import
, which is the new standard.Luckily, since the Roller library is used only as a command-line tool and not meant to be imported as a module, this change shouldn't affect users of the library with projects that are still on CommonJS.
The change also involves replacing
module.exports
withexport
statements.@nicolas-jaussaud I wanted to let you know about this change in advance, just in case it might have unintended effects. In the JS ecosystem the transition has been a bit rough, as some popular libraries converted too early and broke compatibility. It should be fine in our case though.
I was reminded of this when you mentioned
tangible.config.js
starting with:Gradually, I'd like to convert projects (plugins, etc.) to use ES Module style imports. This can be enabled in
package.json
with a single line:And changing the config file to export like this:
This is already supported in the current version of Roller, as it uses
await import()
to load the config file instead ofrequire()
.The text was updated successfully, but these errors were encountered: