artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.05k stars 512 forks source link

fix: add utility functions to get module type #3405

Open jonasclaes opened 1 week ago

jonasclaes commented 1 week ago

Description

This PR will add more complete handling with regards to the CommonJS and ESM standards. This PR should solve #3203 and #2661.

We now look at the extension first, if it's .cjs or .mjs, great, that's easy to resolve. Otherwise, we look for the first package.json we come across, check it's module type, and then determine the project's standards.

The esbuild has been updated to accomodate this change as well.

Pre-merge checklist

This is for use by the Artillery team. Please leave this in if you're contributing to Artillery.

CLAassistant commented 1 week ago

CLA assistant check
All committers have signed the CLA.

hassy commented 2 days ago

thank you @jonasclaes! will aim to review & release in the next version of Artillery