| 137 | } |
| 138 | |
| 139 | function getTarOptions(tgzName, packageName) { |
| 140 | // Files inside the `npm pack`ed archive start |
| 141 | // with "package/" in their paths. We'll undo |
| 142 | // this during extraction. |
| 143 | const CONTENTS_FOLDER = 'package'; |
| 144 | return { |
| 145 | src: tgzName, |
| 146 | dest: `build/node_modules/${packageName}`, |
| 147 | tar: { |
| 148 | entries: [CONTENTS_FOLDER], |
| 149 | map(header) { |
| 150 | if (header.name.indexOf(CONTENTS_FOLDER + '/') === 0) { |
| 151 | header.name = header.name.slice(CONTENTS_FOLDER.length + 1); |
| 152 | } |
| 153 | }, |
| 154 | }, |
| 155 | }; |
| 156 | } |
| 157 | |
| 158 | let entryPointsToHasBundle = new Map(); |
| 159 | // eslint-disable-next-line no-for-of-loops/no-for-of-loops |