npm package diff
Package: @forge/bundler
Versions: 6.1.2-next.1 - 6.1.2-next.0-experimental-8a53773
File: package/out/nativeui.js
Index: package/out/nativeui.js
===================================================================
--- package/out/nativeui.js
+++ package/out/nativeui.js
@@ -8,31 +8,39 @@
async getConfig({ entryPoints, i18nConfig }) {
return (0, nativeui_1.getNativeUiBuildConfig)(entryPoints, i18nConfig);
}
async bundleResources(resources, i18nConfig) {
- const entryPoints = resources.map(({ key, path }) => ({
- name: key,
- path
- }));
const nativeUiBundlesDetails = [];
- if (entryPoints.length > 0) {
- let bundlerOutputs;
+ let combinedMetadata = (0, types_1.emptyMetadata)();
+ await Promise.all(resources.map(async (resource) => {
+ const entryPoint = {
+ name: resource.key,
+ path: resource.path
+ };
+ let bundlerOutput;
try {
- bundlerOutputs = await Promise.all(entryPoints.map((entrypoint) => this.bundle({ appDirectory: '', entryPoints: [entrypoint], i18nConfig })));
+ bundlerOutput = await this.bundle({
+ appDirectory: '',
+ entryPoints: [entryPoint],
+ i18nConfig
+ });
}
catch (e) {
throw new types_1.BundlerError(e.message);
}
- bundlerOutputs.forEach(({ outputDir }, index) => {
- this.logger.debug(`NativeUI bundle created: ${outputDir}`);
- nativeUiBundlesDetails.push({
- ...resources[index],
- path: outputDir
- });
+ const { outputDir, metadata } = bundlerOutput;
+ this.logger.debug(`NativeUI bundle created: ${outputDir}`);
+ nativeUiBundlesDetails.push({
+ ...resource,
+ path: outputDir
});
- }
+ if (metadata) {
+ combinedMetadata = (0, types_1.mergeMetadata)(combinedMetadata, metadata);
+ }
+ }));
return {
- nativeUiBundlesDetails
+ nativeUiBundlesDetails,
+ metadata: combinedMetadata
};
}
}
exports.NativeUIBundler = NativeUIBundler;