npm package diff
Package: @forge/bundler
Versions: 4.20.1-next.6 - 4.20.1-next.7
File: package/out/nativeui.js
Index: package/out/nativeui.js
===================================================================
--- package/out/nativeui.js
+++ package/out/nativeui.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NativeUIBundler = void 0;
+const nativeui_1 = require("./config/nativeui");
+const types_1 = require("./types");
+const webpack_1 = require("./webpack");
+class NativeUIBundler extends webpack_1.WebpackBundler {
+ 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;
+ try {
+ bundlerOutputs = await Promise.all(entryPoints.map((entrypoint) => 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
+ });
+ });
+ }
+ return {
+ nativeUiBundlesDetails
+ };
+ }
+}
+exports.NativeUIBundler = NativeUIBundler;