How to use the @ui5/fs.Resource function in @ui5/fs

To help you get started, we’ve selected a few @ui5/fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / ui5-builder / lib / processors / bundlers / moduleBundler.js View on Github external
return Promise.all(bundles.map(function({name, content, bundleInfo}) {
				// console.log("creating bundle as '%s'", "/resources/" + name);
				const resource = new EvoResource({
					path: "/resources/" + name,
					string: content
				});
				return resource;
			}));
		});
github SAP / ui5-builder / lib / processors / resourceListCreator.js View on Github external
pool,
		debugResources: options.debugResources,
		mergedResources: options.mergedResources,
		designtimeResources: options.designtimeResources,
		supportResources: options.supportResources
	});

	// group resources by components and create ResourcesLists
	collector.groupResourcesByComponents();

	const resourceLists = [];

	// write out resources.json files
	for (const [prefix, list] of collector.components.entries()) {
		log.info(`	writing '${prefix}resources.json'`);
		resourceLists.push(new EvoResource({
			path: `/resources/${prefix}resources.json`,
			string: JSON.stringify(list, null, "\t")
		}));
	}
	for (const [prefix, list] of collector.themePackages.entries()) {
		log.info(`	writing '${prefix}resources.json'`);
		resourceLists.push(new EvoResource({
			path: `/resources/${prefix}resources.json`,
			string: JSON.stringify(list, null, "\t")
		}));
	}
	const unassigned = collector.resources;
	if ( unassigned.size > 0 ) {
		log.warn(`  found ${unassigned.size} resources not belonging to a component (orphans)`);
		let n = 0;
		for ( const resource of unassigned ) {
github SAP / ui5-builder / lib / processors / themeBuilder.js View on Github external
}).then((result) => {
				const themeDir = path.dirname(resource.getPath());

				const libCss = new Resource({
					path: themeDir + "/library.css",
					string: result.css
				});

				const libCssRtl = new Resource({
					path: themeDir + "/library-RTL.css",
					string: result.cssRtl
				});

				const libParams = new Resource({
					path: themeDir + "/library-parameters.json",
					string: JSON.stringify(result.variables, null, compress ? null : "\t")
				});

				files.push(libCss, libCssRtl, libParams);
			});
github SAP / ui5-builder / lib / processors / themeBuilder.js View on Github external
}).then((result) => {
				const themeDir = path.dirname(resource.getPath());

				const libCss = new Resource({
					path: themeDir + "/library.css",
					string: result.css
				});

				const libCssRtl = new Resource({
					path: themeDir + "/library-RTL.css",
					string: result.cssRtl
				});

				const libParams = new Resource({
					path: themeDir + "/library-parameters.json",
					string: JSON.stringify(result.variables, null, compress ? null : "\t")
				});

				files.push(libCss, libCssRtl, libParams);
			});
		};
github SAP / ui5-builder / lib / processors / themeBuilder.js View on Github external
}).then((result) => {
				const themeDir = path.dirname(resource.getPath());

				const libCss = new Resource({
					path: themeDir + "/library.css",
					string: result.css
				});

				const libCssRtl = new Resource({
					path: themeDir + "/library-RTL.css",
					string: result.cssRtl
				});

				const libParams = new Resource({
					path: themeDir + "/library-parameters.json",
					string: JSON.stringify(result.variables, null, compress ? null : "\t")
				});

				files.push(libCss, libCssRtl, libParams);
			});
		};