|
|
|
|
@ -75,7 +75,15 @@ function packDirectory(dirName, dirPath) {
|
|
|
|
|
description: `Haina ${dirName} module - part of @haina/npm utility library`,
|
|
|
|
|
main: `build/cjs/${dirName}/index.js`, // Assuming there's an index.js in the directory
|
|
|
|
|
module: `build/esm/${dirName}/index.js`,
|
|
|
|
|
type: 'module',
|
|
|
|
|
exports: {
|
|
|
|
|
".": {
|
|
|
|
|
"import": `./build/esm/${dirName}/index.js`,
|
|
|
|
|
"require": `./build/cjs/${dirName}/index.js`,
|
|
|
|
|
},
|
|
|
|
|
"./esm/*": "./build/esm/*",
|
|
|
|
|
"./cjs/*": "./build/cjs/*"
|
|
|
|
|
},
|
|
|
|
|
// type: 'module',
|
|
|
|
|
files: [
|
|
|
|
|
"build"
|
|
|
|
|
],
|
|
|
|
|
@ -146,7 +154,13 @@ function packIndividualFile(fileName, parentDir, parentPath) {
|
|
|
|
|
description: `Haina ${parentDir}-${moduleName} module - part of @haina/npm utility library`,
|
|
|
|
|
main: parentDir === 'src' ? `build/cjs/${fileName}` : `build/cjs/${parentDir}/${fileName}`,
|
|
|
|
|
module: parentDir === 'src' ? `build/esm/${fileName}` : `build/esm/${parentDir}/${fileName}`,
|
|
|
|
|
type: 'module',
|
|
|
|
|
exports: {
|
|
|
|
|
".": {
|
|
|
|
|
"import": parentDir === 'src' ? `./build/esm/${fileName}` : `./build/esm/${parentDir}/${fileName}`,
|
|
|
|
|
"require": parentDir === 'src' ? `./build/cjs/${fileName}` : `./build/cjs/${parentDir}/${fileName}`
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// type: 'module',
|
|
|
|
|
files: [
|
|
|
|
|
"build"
|
|
|
|
|
],
|
|
|
|
|
|