File tree Expand file tree Collapse file tree 4 files changed +18
-8
lines changed
Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ export const buildConfig = {
6767 platform : 'node' ,
6868 target : 'node18' ,
6969 sourcemap : true ,
70- // Minify for production builds (can be overridden in watch mode)
71- minify : true ,
70+ // Don't minify - this is a library and minification breaks ESM/CJS interop
71+ minify : false ,
7272 // Tree-shaking optimization
7373 treeShaking : true ,
7474 metafile : true ,
Original file line number Diff line number Diff line change @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 3.0.3] ( https://github.com/SocketDev/socket-lib/releases/tag/v3.0.3 ) - 2025-11-01
9+
10+ ### Fixed
11+
12+ - ** Critical: Node.js ESM/CJS interop completely fixed** : Disabled minification to ensure proper ESM named import detection
13+ - Root cause: esbuild minification was breaking Node.js ESM's CJS named export detection
14+ - Solution: Disabled minification entirely (` minify: false ` in esbuild config)
15+ - Libraries should not be minified - consumers minify during their own build process
16+ - Unminified esbuild output uses clear ` __export ` patterns that Node.js ESM natively understands
17+ - Removed ` fix-commonjs-exports.mjs ` build script - no longer needed with unminified code
18+ - ESM imports now work reliably: ` import { getDefaultLogger } from '@socketsecurity/lib/logger' `
19+ - Verified with real-world ESM module testing (` .mjs ` files importing from CJS ` .js ` dist)
20+
821## [ 3.0.2] ( https://github.com/SocketDev/socket-lib/releases/tag/v3.0.2 ) - 2025-11-01
922
1023### Fixed
Original file line number Diff line number Diff line change 11{
22 "name" : " @socketsecurity/lib" ,
3- "version" : " 3.0.2 " ,
3+ "version" : " 3.0.3 " ,
44 "license" : " MIT" ,
55 "description" : " Core utilities and infrastructure for Socket.dev security tools" ,
66 "keywords" : [
Original file line number Diff line number Diff line change 11/**
22 * @fileoverview Orchestrates all post-build fix scripts.
3- * Runs generate-package-exports, fix-commonjs-exports, and fix-external-imports in sequence.
3+ * Runs generate-package-exports and fix-external-imports in sequence.
44 */
55
66import { isQuiet } from './utils/flags.mjs'
@@ -28,10 +28,7 @@ async function main() {
2828 args : [ 'scripts/generate-package-exports.mjs' , ...fixArgs ] ,
2929 command : 'node' ,
3030 } ,
31- {
32- args : [ 'scripts/fix-commonjs-exports.mjs' , ...fixArgs ] ,
33- command : 'node' ,
34- } ,
31+ // fix-commonjs-exports no longer needed - unminified esbuild output is ESM-compatible
3532 {
3633 args : [ 'scripts/fix-external-imports.mjs' , ...fixArgs ] ,
3734 command : 'node' ,
You can’t perform that action at this time.
0 commit comments