@awesomeness-js/utils 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/build.js +5 -4
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -64,7 +64,7 @@ function extractJSDocComment(filePath) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
function generateExports(src) {
|
|
67
|
+
function generateExports(src, exportRoots) {
|
|
68
68
|
const allFiles = [];
|
|
69
69
|
const fnFiles = getAllFiles(src, '.');
|
|
70
70
|
allFiles.push(...fnFiles);
|
|
@@ -96,7 +96,7 @@ function generateExports(src) {
|
|
|
96
96
|
imports += `import ${namespace}_${functionName} from '${importPath}.js';\n`;
|
|
97
97
|
|
|
98
98
|
// generate exports
|
|
99
|
-
if(!namespace){ allExports += `export { _${functionName} as ${functionName} };\n`; }
|
|
99
|
+
if(exportRoots && !namespace){ allExports += `export { _${functionName} as ${functionName} };\n`; }
|
|
100
100
|
|
|
101
101
|
// Populate the API object structure
|
|
102
102
|
let current = apiObject;
|
|
@@ -123,9 +123,10 @@ function generateExports(src) {
|
|
|
123
123
|
|
|
124
124
|
async function build({
|
|
125
125
|
src = './src',
|
|
126
|
-
dest = './index.js'
|
|
126
|
+
dest = './index.js',
|
|
127
|
+
exportRoots = true
|
|
127
128
|
} = {}) {
|
|
128
|
-
const indexContent = generateExports(src);
|
|
129
|
+
const indexContent = generateExports(src, exportRoots);
|
|
129
130
|
writeFileSync(dest, indexContent);
|
|
130
131
|
return true;
|
|
131
132
|
}
|