mirror of
https://github.com/dzeiocom/libs.git
synced 2025-04-22 02:42:13 +00:00
feat(logger): Add support for ESM
Signed-off-by: Avior <github@avior.me>
This commit is contained in:
parent
0eb2468895
commit
ec78032aa1
@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.1.0] - 2023-06-28
|
||||
|
||||
### Added
|
||||
|
||||
- Support for ESM
|
||||
|
||||
## [2.0.4] - 2021-02-08
|
||||
|
||||
### Removed
|
||||
|
2714
packages/logger/package-lock.json
generated
Normal file
2714
packages/logger/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@dzeio/logger",
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"description": "My Personnal Logger",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -10,7 +10,21 @@
|
||||
"author": "Aviortheking",
|
||||
"license": "MIT",
|
||||
"main": "./dist/Logger.js",
|
||||
"module": "./dist/Logger.mjs",
|
||||
"types": "./dist/Logger.d.ts",
|
||||
"browser": "./dist/Logger.global.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": {
|
||||
"types": "./dist/Logger.d.ts",
|
||||
"default": "./dist/Logger.js"
|
||||
},
|
||||
"import": {
|
||||
"default": "./dist/Logger.mjs",
|
||||
"types": "./dist/Logger.d.mts"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-colors": "^4.1.1"
|
||||
},
|
||||
@ -18,11 +32,11 @@
|
||||
"@typescript-eslint/eslint-plugin": "^4.5.0",
|
||||
"@typescript-eslint/parser": "^4.5.0",
|
||||
"eslint": "^7.4.0",
|
||||
"parcel": "1.12.3"
|
||||
"tsup": "^7.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run build",
|
||||
"build": "parcel build src/index.ts --out-file browser.js --experimental-scope-hoisting && tsc",
|
||||
"build": "tsup ./src/Logger.ts --format cjs,esm --dts --clean && tsup ./src/Logger.ts --format iife --global-name Logger --sourcemap",
|
||||
"test": "ts-node test"
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
import Logger from './Logger'
|
||||
|
||||
// Browser Import
|
||||
|
||||
/**
|
||||
* Init Logger in global context and add function to replace default console
|
||||
*/
|
||||
|
||||
// @ts-expect-error
|
||||
window.Logger = Logger
|
||||
// @ts-expect-error
|
||||
window.logger = new Logger('Console')
|
||||
// @ts-expect-error
|
||||
window.initConsole = function() {
|
||||
console.log('// @deprecated Now use window.logger to get the correct logger')
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user