Enable full ESM support for Node 20+ and modern dependencies, update Jest and build output configuration
- Set "type": "module" in package.json to enable ESM throughout the project. - Changed "main" in package.json to "dist/index.js" to point to the bundled output generated by ncc. - Updated Jest configuration (jest.config.js) to ESM format and to use babel-jest for TypeScript transformation. - Added/updated babel.config.js in ESM format to support TypeScript and ESM for Jest. - Ensured test scripts use NODE_OPTIONS=--experimental-vm-modules for Jest ESM compatibility.
This commit is contained in:
+3
-2
@@ -2,11 +2,12 @@
|
||||
"name": "component-detection-action",
|
||||
"version": "1.0.0",
|
||||
"description": "Component detection action",
|
||||
"main": "index.ts",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"prepare": "ncc build index.ts -o dist --source-map --license licenses.txt",
|
||||
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
||||
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
||||
"all": "npm run lint && npm run prepare && npm run test"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user