ui5-community / babel-plugin-transform-modules-ui5

A Babel transformer plugin for OpenUI5/SAPUI5. It allows you to develop UI5 applications by using the latest ECMAScript or TypeScript, including new syntax and objective oriented programming technology.
MIT License
34 stars 16 forks source link

fix: add support for import.meta.url|resolve #106

Closed petermuessig closed 1 year ago

petermuessig commented 1 year ago

With this change we add support for import.meta.url and import.meta.resolve() for the transpilation step of the plugin.

This is how import.meta.url is handled:

// ES syntax:
import.meta.url;

// UI5 AMD-like syntax:
sap.ui.define(["module"], function(module) {

  module.url;

});

This is how import.meta.resolve(...) is handled:

// ES syntax:
import.meta.resolve(...);

// UI5 AMD-like syntax:
sap.ui.define(["require"], function(require) {

  require.toUrl(...);

});

Fixes #103