Skip to content

Commit

Permalink
fix: move to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
EladBezalel committed Oct 24, 2023
1 parent 60a7238 commit d93b362
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion libs/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@traf/core",
"version": "0.0.13",
"type": "commonjs",
"type": "module",
"license": "MIT",
"description": "Find truly affected pacakges in monorepos",
"repository": {
Expand Down
13 changes: 11 additions & 2 deletions libs/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"dependsOn": ["emit-types"],
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/core",
"main": "libs/core/src/index.ts",
"additionalEntryPoints": ["libs/core/src/index.ts"],
"tsConfig": "libs/core/tsconfig.lib.json",
"assets": ["libs/core/*.md"]
"assets": ["libs/core/*.md"],
"generatePackageJson": true,
"deleteOutputPath": false,
"esbuildOptions": {
"banner": {
"js": "import { dirname as __dirname__ } from 'path';import { fileURLToPath } from 'url';import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);const __filename = fileURLToPath(import.meta.url);const __dirname = __dirname__(__filename);"
}
}
}
},
"lint": {
Expand Down
6 changes: 0 additions & 6 deletions libs/nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,5 @@
},
"bin": {
"traf-nx": "bin/traf-nx.js"
},
"exports": {
".": {
"require": "./index.cjs",
"import": "./index.js"
}
}
}
3 changes: 1 addition & 2 deletions libs/nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"banner": {
"js": "import { dirname as __dirname__ } from 'path';import { fileURLToPath } from 'url';import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);const __filename = fileURLToPath(import.meta.url);const __dirname = __dirname__(__filename);"
}
},
"format": ["cjs", "esm"]
}
}
},
"lint": {
Expand Down
7 changes: 6 additions & 1 deletion libs/nx/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/__fixtures__/**/*"]
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/__fixtures__/**/*"
]
}
7 changes: 1 addition & 6 deletions libs/turbo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@traf/turbo",
"version": "0.0.13",
"type": "module",
"main": "index.js",
"types": "src/index.d.ts",
"license": "MIT",
Expand All @@ -24,11 +25,5 @@
},
"bin": {
"traf-turbo": "bin/traf-turbo.js"
},
"exports": {
".": {
"require": "./index.cjs",
"import": "./index.js"
}
}
}
3 changes: 1 addition & 2 deletions libs/turbo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"banner": {
"js": "import { dirname as __dirname__ } from 'path';import { fileURLToPath } from 'url';import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);const __filename = fileURLToPath(import.meta.url);const __dirname = __dirname__(__filename);"
}
},
"format": ["cjs", "esm"]
}
}
},
"lint": {
Expand Down

0 comments on commit d93b362

Please sign in to comment.