Skip to content

Commit

Permalink
fix: correctly produce esm module
Browse files Browse the repository at this point in the history
  • Loading branch information
iSplasher committed Sep 4, 2024
1 parent b8f3bc9 commit 2fc2a9a
Show file tree
Hide file tree
Showing 5 changed files with 460 additions and 192 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
},
"homepage": "https://github.com/iSplasher/isomorphic-logger",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"scripts": {
"dev": "cross-env NODE_ENV=development tsup --format esm,cjs --watch",
"types": "tsc",
"build": "cross-env NODE_ENV=production tsup --format esm,cjs && yarn types || true",
"dev": "cross-env NODE_ENV=development tsup --watch",
"esm": "tsc",
"build": "cross-env NODE_ENV=production tsup && yarn esm || true",
"test": "jest --colors"
},
"devDependencies": {
"@types/jest": "^29.5.5",
"cross-env": "^7.0.3",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"tsup": "^7.2.0",
"tsup": "^8.2.4",
"typescript": "^5.2.2"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/server/processors/createRollingFileAppendProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function createRollingFileAppendProcessor({
maxFileSize = 102400,
...fileAppenderOptions
} = {}): Processor {
const fileAppender = createFileAppendProcessor(filePath, fileAppenderOptions);
const fileAppender = createFileAppendProcessor({filePath, ...fileAppenderOptions});

let index = 1;
while (true) {
Expand Down
18 changes: 9 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"compilerOptions": {
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"emitDeclarationOnly": true,
"target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"declaration": true,
"moduleResolution": "node",

/* Modules */
"module": "commonjs" /* Specify what module code is generated. */,
"outDir": "./dist",
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

"module": "ES6", /* Specify what module code is generated. */
"outDir": "./dist/esm",
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"isolatedModules": true,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied `any` type.. */,
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["./src/**/*"],
"include": ["./src/**/*.ts"],
"exclude": ["./node_modules", "./dist"]
}
14 changes: 5 additions & 9 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
skipNodeModulesBundle: true,
treeshake: true,
shims: true,
splitting: true,
sourcemap: true,
clean: true,
format: ["cjs", "esm", "iife"],
format: ["cjs"],
target: [
"es6",
"deno1",
"chrome58",
"edge16",
"firefox57",
"safari11",
"node12",
"ios16.6",
// "hermes0.73",
],
bundle: false,
bundle: true,
// dts: true,
});
Loading

0 comments on commit 2fc2a9a

Please sign in to comment.