Add ESM Module support

This commit is contained in:
Fabian Stamm 2023-10-14 16:54:53 +02:00
parent 6c65d2c83d
commit 08fabf5bf8
7 changed files with 39 additions and 8 deletions

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated

3
.gitignore vendored
View File

@ -2,4 +2,7 @@ node_modules/
logs/ logs/
yarn.lock yarn.lock
out/ out/
esm/
.history/ .history/
.yarn/cache
.yarn/install-state.gz

Binary file not shown.

BIN
.yarn/releases/yarn-3.6.4.cjs vendored Executable file

Binary file not shown.

11
.yarnrc.yml Normal file
View File

@ -0,0 +1,11 @@
nodeLinker: node-modules
npmScopes:
"hibas123":
npmRegistryServer: "https://git.hibas.dev/api/packages/hibas123/npm/"
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.6.4.cjs

View File

@ -1,12 +1,13 @@
{ {
"name": "@hibas123/nodelogging", "name": "@hibas123/nodelogging",
"version": "3.1.3", "packageManager": "yarn@3.6.4",
"version": "3.1.5",
"description": "", "description": "",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",
"scripts": { "scripts": {
"prepublish": "npm run build", "prepublish": "npm run build",
"build": "tsc", "build": "tsc && tsc -p tsconfig.esm.json",
"watch-ts": "tsc --watch", "watch-ts": "tsc --watch",
"watch-js": "nodemon out/test.js", "watch-js": "nodemon out/test.js",
"watch": "concurrently npm:watch-*", "watch": "concurrently npm:watch-*",
@ -23,14 +24,15 @@
"files": [ "files": [
"src/", "src/",
"out/", "out/",
"esm/",
"tsconfig.json", "tsconfig.json",
"readme.md" "readme.md"
], ],
"devDependencies": { "devDependencies": {
"@types/node": "^15.3.0", "@types/node": "^20.8.6",
"concurrently": "^6.1.0", "concurrently": "^8.2.1",
"nodemon": "^2.0.7", "nodemon": "^3.0.1",
"typescript": "^4.2.4" "typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"@hibas123/logging": "^3.1.2", "@hibas123/logging": "^3.1.2",

11
tsconfig.esm.json Normal file
View File

@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"target": "ES2017",
"moduleResolution": "node",
"outDir": "esm"
},
"exclude": ["node_modules"],
"include": ["src"]
}