For some our modules we have to use require or else the module always fails. But, if we try to use require (and only require) in a step in V2, we get the following error: ‘import’ and ‘export’ may appear only with ‘sourceType: module’ (2:0)
Sample code is below.
const shippo = require('shippo')(process.env.YOURSHIPPOID);
export default defineComponent({
async run({ steps, $ }) {
// this Node.js code will execute when the step runs
return shippo
}
});