From 8a20c4257a1ebe4d613b0595be93cd45d900f580 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Wed, 23 Feb 2022 18:35:32 +0100 Subject: [PATCH] [FEATURE] Generate source maps for bundles (#695) Resolves https://github.com/SAP/ui5-tooling/issues/472 Supersedes https://github.com/SAP/ui5-builder/pull/282 Based on https://github.com/SAP/ui5-tooling/pull/583 JIRA: CPOUI5FOUNDATION-434 Co-authored-by: Matthias Osswald --- lib/lbt/bundle/Builder.js | 463 ++++-- lib/lbt/bundle/BundleWriter.js | 17 + lib/lbt/resources/LocatorResource.js | 14 +- lib/lbt/resources/LocatorResourcePool.js | 12 +- lib/processors/bundlers/moduleBundler.js | 35 +- lib/processors/minifier.js | 15 +- lib/tasks/bundlers/generateBundle.js | 92 +- .../bundlers/generateComponentPreload.js | 17 +- lib/tasks/bundlers/generateLibraryPreload.js | 64 +- .../bundlers/generateStandaloneAppBundle.js | 53 +- lib/tasks/generateResourcesJson.js | 2 +- lib/tasks/minify.js | 14 +- package-lock.json | 7 +- package.json | 1 + .../application.a/dest-deps-excl/test.js | 3 +- .../resources/library/d/some.js | 3 +- .../dest-deps-incl/resources/ui5loader.js | 2 - .../application.a/dest-deps-incl/test.js | 3 +- .../dest-deps/resources/library/d/some.js | 3 +- .../dest-deps/resources/ui5loader.js | 2 - .../build/application.a/dest-deps/test.js | 3 +- .../dest-depself/resources/library/d/some.js | 3 +- .../resources/sap-ui-custom-dbg.js | 1 + .../resources/sap-ui-custom-dbg.js.map | 1 + .../dest-depself/resources/sap-ui-custom.js | 9 +- .../resources/sap-ui-custom.js.map | 1 + .../dest-depself/resources/ui5loader.js | 2 - .../build/application.a/dest-depself/test.js | 3 +- .../dest-self/resources/sap-ui-custom-dbg.js | 1 + .../resources/sap-ui-custom-dbg.js.map | 1 + .../dest-self/resources/sap-ui-custom.js | 8 +- .../dest-self/resources/sap-ui-custom.js.map | 1 + .../build/application.a/dest-self/test.js | 3 +- .../expected/build/application.a/dest/test.js | 3 +- .../dest/embedded/i18n_fr.properties | 1 + .../build/application.b/dest/i18n.properties | 2 + .../application.b/dest/i18n/l10n.properties | 2 + .../application.b/dest/manifest-bundle.zip | Bin 0 -> 1129 bytes .../standalone/resources/sap-ui-custom-dbg.js | 1 + .../resources/sap-ui-custom-dbg.js.map | 1 + .../standalone/resources/sap-ui-custom.js | 4 +- .../standalone/resources/sap-ui-custom.js.map | 1 + .../cachebuster/Component-preload.js | 13 +- .../cachebuster/Component-preload.js.map | 1 + .../application.g/cachebuster/Component.js | 3 +- .../cachebuster/sap-ui-cachebuster-info.json | 27 +- .../cachebuster/subcomponentA/Component.js | 3 +- .../cachebuster/subcomponentB/Component.js | 3 +- .../cachebuster_hash/Component-preload.js | 13 +- .../cachebuster_hash/Component-preload.js.map | 1 + .../cachebuster_hash/Component.js | 3 +- .../sap-ui-cachebuster-info.json | 17 +- .../subcomponentA/Component.js | 3 +- .../subcomponentB/Component.js | 3 +- .../application.g/dest/Component-preload.js | 5 +- .../dest/Component-preload.js.map | 1 + .../build/application.g/dest/Component.js | 3 +- .../dest/subcomponentA/Component-preload.js | 5 +- .../subcomponentA/Component-preload.js.map | 1 + .../dest/subcomponentA/Component.js | 3 +- .../dest/subcomponentB/Component-preload.js | 5 +- .../subcomponentB/Component-preload.js.map | 1 + .../dest/subcomponentB/Component.js | 3 +- .../application.g/dest2/Component-preload.js | 5 +- .../dest2/Component-preload.js.map | 1 + .../build/application.g/dest2/Component.js | 3 +- .../dest2/subcomponentA/Component-preload.js | 5 +- .../subcomponentA/Component-preload.js.map | 1 + .../dest2/subcomponentA/Component.js | 3 +- .../dest2/subcomponentB/Component-preload.js | 5 +- .../subcomponentB/Component-preload.js.map | 1 + .../dest2/subcomponentB/Component.js | 3 +- .../build/application.h/dest/Component.js | 3 +- .../dest/sectionsA/customBundle.js | 9 +- .../dest/sectionsA/customBundle.js.map | 1 + .../application.h/dest/sectionsA/section1.js | 3 +- .../application.h/dest/sectionsA/section2.js | 3 +- .../application.h/dest/sectionsA/section3.js | 3 +- .../dest/sectionsB/customBundle.js | 10 +- .../dest/sectionsB/customBundle.js.map | 1 + .../application.h/dest/sectionsB/section1.js | 3 +- .../application.h/dest/sectionsB/section2.js | 3 +- .../application.h/dest/sectionsB/section3.js | 3 +- .../no-minify/sectionsA/customBundle.js | 7 +- .../no-minify/sectionsA/customBundle.js.map | 1 + .../no-minify/sectionsB/customBundle.js | 10 +- .../no-minify/sectionsB/customBundle.js.map | 1 + .../application.i/dest/Component-preload.js | 9 +- .../dest/Component-preload.js.map | 1 + .../build/application.i/dest/Component.js | 3 +- .../dest/changes/coding/MyExtension.js | 3 +- .../dest-resources-json/Component-preload.js | 9 +- .../Component-preload.js.map | 1 + .../dest-resources-json/Component.js | 3 +- .../changes/coding/MyExtension.js | 3 +- .../dest-resources-json/resources.json | 13 +- .../application.j/dest/Component-preload.js | 9 +- .../dest/Component-preload.js.map | 1 + .../build/application.j/dest/Component.js | 3 +- .../dest/changes/coding/MyExtension.js | 3 +- .../Component-preload.js | 13 +- .../Component-preload.js.map | 1 + .../application.k/dest/Component-preload.js | 4 +- .../dest/Component-preload.js.map | 1 + .../dest/subcomponentA/Component-preload.js | 4 +- .../subcomponentA/Component-preload.js.map | 1 + .../dest/subcomponentB/Component-preload.js | 7 +- .../subcomponentB/Component-preload.js.map | 1 + .../build/application.l/dest/subdir/index.js | 3 +- .../dest/subdir/thirdparty/File1.js | 3 +- .../expected/build/application.l/dest/test.js | 3 +- .../dest/Component-preload.js" | 5 +- .../dest/Component-preload.js.map" | 1 + .../application.\303\270/dest/Component.js" | 3 +- .../dest/resources/sap-ui-core-dbg.js | 0 .../dest/resources/sap-ui-core.js | 2 - .../dest/resources/sap/ui/Global-dbg.js | 5 - .../dest/resources/sap/ui/Global.js | 5 - .../dest/resources/sap/ui/core/.library | 20 - .../dest/resources/sap/ui/core/Core-dbg.js | 5 - .../dest/resources/sap/ui/core/Core.js | 5 - .../dest/resources/library/d/some.js | 3 +- .../resources/library/d/library-preload.js | 4 +- .../library/d/library-preload.js.map | 1 + .../dest/resources/library/e/library.js | 3 +- .../dest/resources/library/e/some.js | 3 +- .../library/h/components/Component-preload.js | 9 +- .../h/components/Component-preload.js.map | 1 + .../library/h/components/Component.js | 3 +- .../library/h/components/TodoComponent.js | 3 +- .../library/h/components/resources.json | 40 +- .../subcomponent1/Component-preload.js | 5 +- .../subcomponent1/Component-preload.js.map | 1 + .../h/components/subcomponent1/Component.js | 3 +- .../h/components/subcomponent1/resources.json | 11 +- .../subcomponent2/Component-preload.js | 5 +- .../subcomponent2/Component-preload.js.map | 1 + .../h/components/subcomponent2/Component.js | 3 +- .../h/components/subcomponent2/resources.json | 11 +- .../subcomponent3/Component-preload.js | 5 +- .../subcomponent3/Component-preload.js.map | 1 + .../h/components/subcomponent3/Component.js | 3 +- .../h/components/subcomponent3/resources.json | 11 +- .../resources/library/h/customBundle-dbg.js | 10 +- .../library/h/customBundle-dbg.js.map | 1 + .../resources/library/h/customBundle.js | 14 +- .../resources/library/h/customBundle.js.map | 1 + .../h/designtime/library.designtime.js | 3 +- .../resources/library/h/file.js | 3 +- .../resources/library/h/library.js | 3 +- .../resources/library/h/not.js | 3 +- .../resources/library/h/resources.json | 64 +- .../resources/library/h/some.js | 3 +- .../library/h/components/Component-preload.js | 9 +- .../h/components/Component-preload.js.map | 1 + .../library/h/components/Component.js | 3 +- .../library/h/components/TodoComponent.js | 3 +- .../subcomponent1/Component-preload.js | 5 +- .../subcomponent1/Component-preload.js.map | 1 + .../h/components/subcomponent1/Component.js | 3 +- .../subcomponent2/Component-preload.js | 5 +- .../subcomponent2/Component-preload.js.map | 1 + .../h/components/subcomponent2/Component.js | 3 +- .../subcomponent3/Component-preload.js | 5 +- .../subcomponent3/Component-preload.js.map | 1 + .../h/components/subcomponent3/Component.js | 3 +- .../resources/library/h/customBundle-dbg.js | 10 +- .../library/h/customBundle-dbg.js.map | 1 + .../dest/resources/library/h/customBundle.js | 14 +- .../resources/library/h/customBundle.js.map | 1 + .../h/designtime/library.designtime.js | 3 +- .../dest/resources/library/h/file.js | 3 +- .../dest/resources/library/h/library.js | 3 +- .../library.h/dest/resources/library/h/not.js | 3 +- .../dest/resources/library/h/some.js | 3 +- .../library/h/components/Component-preload.js | 7 +- .../h/components/Component-preload.js.map | 1 + .../subcomponent1/Component-preload.js | 4 +- .../subcomponent1/Component-preload.js.map | 1 + .../subcomponent2/Component-preload.js | 4 +- .../subcomponent2/Component-preload.js.map | 1 + .../subcomponent3/Component-preload.js | 4 +- .../subcomponent3/Component-preload.js.map | 1 + .../resources/library/h/customBundle-dbg.js | 10 +- .../library/h/customBundle-dbg.js.map | 1 + .../resources/library/h/customBundle.js | 10 +- .../resources/library/h/customBundle.js.map | 1 + .../dest/resources/library/l/some.js | 3 +- .../dest/resources/library/l/subdir/index.js | 3 +- .../library/l/subdir/thirdparty/File1.js | 3 +- .../library/\303\270/library-preload.js" | 5 +- .../library/\303\270/library-preload.js.map" | 1 + .../\303\270/library-preload.support.js" | 1 + .../\303\270/library-preload.support.js.map" | 1 + .../dest/resources/library/\303\270/some.js" | 3 +- .../dest/resources/sap-ui-core.js | 2 - .../dest/resources/sap/ui/Global.js | 3 +- .../dest/resources/sap/ui/core/Core.js | 3 +- .../preload/resources/sap-ui-core-dbg.js | 1 + .../preload/resources/sap-ui-core-dbg.js.map | 1 + .../resources/sap-ui-core-nojQuery-dbg.js | 1 + .../resources/sap-ui-core-nojQuery-dbg.js.map | 1 + .../preload/resources/sap-ui-core-nojQuery.js | 6 +- .../resources/sap-ui-core-nojQuery.js.map | 1 + .../preload/resources/sap-ui-core.js | 6 +- .../preload/resources/sap-ui-core.js.map | 1 + .../preload/resources/sap/ui/core/Core.js | 3 +- .../resources/sap/ui/core/library-preload.js | 13 +- .../sap/ui/core/library-preload.js.map | 1 + .../preload/resources/sap/ui/core/one.js | 3 +- .../preload/resources/sap/ui/core/some.js | 3 +- .../preload/resources/ui5loader-autoconfig.js | 3 +- .../preload/resources/ui5loader.js | 3 +- test/fixtures/application.h/ui5.yaml | 25 - test/fixtures/application.i/ui5.yaml | 25 - test/fixtures/application.j/ui5.yaml | 25 - "test/fixtures/application.\303\270/ui5.yaml" | 9 - test/lib/builder/builder.js | 2 +- test/lib/lbt/bundle/Builder.js | 1268 ++++++++++++++++- test/lib/processors/bundlers/moduleBundler.js | 40 +- .../bundlers/generateComponentPreload.js | 112 +- .../generateLibraryPreload.integration.js | 37 +- .../tasks/bundlers/generateLibraryPreload.js | 18 +- .../generateManifestBundle.integration.js | 2 +- ...generateStandaloneAppBundle.integration.js | 2 +- test/lib/tasks/minify.js | 72 +- 226 files changed, 2601 insertions(+), 707 deletions(-) create mode 100644 test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js.map create mode 100644 test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js.map create mode 100644 test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js.map create mode 100644 test/expected/build/application.a/dest-self/resources/sap-ui-custom.js.map create mode 100644 test/expected/build/application.b/dest/embedded/i18n_fr.properties create mode 100644 test/expected/build/application.b/dest/i18n.properties create mode 100644 test/expected/build/application.b/dest/i18n/l10n.properties create mode 100644 test/expected/build/application.b/dest/manifest-bundle.zip create mode 100644 test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js.map create mode 100644 test/expected/build/application.b/standalone/resources/sap-ui-custom.js.map create mode 100644 test/expected/build/application.g/cachebuster/Component-preload.js.map create mode 100644 test/expected/build/application.g/cachebuster_hash/Component-preload.js.map create mode 100644 test/expected/build/application.g/dest/Component-preload.js.map create mode 100644 test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map create mode 100644 test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map create mode 100644 test/expected/build/application.g/dest2/Component-preload.js.map create mode 100644 test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map create mode 100644 test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map create mode 100644 test/expected/build/application.h/dest/sectionsA/customBundle.js.map create mode 100644 test/expected/build/application.h/dest/sectionsB/customBundle.js.map create mode 100644 test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map create mode 100644 test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map create mode 100644 test/expected/build/application.i/dest/Component-preload.js.map create mode 100644 test/expected/build/application.j/dest-resources-json/Component-preload.js.map create mode 100644 test/expected/build/application.j/dest/Component-preload.js.map create mode 100644 test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map create mode 100644 test/expected/build/application.k/dest/Component-preload.js.map create mode 100644 test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map create mode 100644 test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map create mode 100644 "test/expected/build/application.\303\270/dest/Component-preload.js.map" delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core-dbg.js delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js delete mode 100644 test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js create mode 100644 test/expected/build/library.d/preload/resources/library/d/library-preload.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js.map create mode 100644 test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js.map create mode 100644 test/expected/build/library.h/dest/resources/library/h/customBundle.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js.map create mode 100644 test/expected/build/library.h/no-minify/resources/library/h/customBundle.js.map create mode 100644 "test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js.map" create mode 100644 "test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js.map" create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map create mode 100644 test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js.map delete mode 100644 test/fixtures/application.h/ui5.yaml delete mode 100644 test/fixtures/application.i/ui5.yaml delete mode 100644 test/fixtures/application.j/ui5.yaml delete mode 100644 "test/fixtures/application.\303\270/ui5.yaml" diff --git a/lib/lbt/bundle/Builder.js b/lib/lbt/bundle/Builder.js index 01dc34ae3..cd68b2a24 100644 --- a/lib/lbt/bundle/Builder.js +++ b/lib/lbt/bundle/Builder.js @@ -5,7 +5,7 @@ const path = require("path"); const {pd} = require("pretty-data"); const {parseJS, Syntax} = require("../utils/parseUtils"); -// const MOZ_SourceMap = require("source-map"); +const {encode: encodeMappings, decode: decodeMappings} = require("sourcemap-codec"); const {isMethodCall} = require("../utils/ASTUtils"); const ModuleName = require("../utils/ModuleName"); @@ -18,6 +18,8 @@ const {SectionType} = require("./BundleDefinition"); const BundleWriter = require("./BundleWriter"); const log = require("@ui5/logger").getLogger("lbt:bundle:Builder"); +const sourceMappingUrlPattern = /\/\/# sourceMappingURL=(.+)\s*$/; +const httpPattern = /^https?:\/\//i; const xmlHtmlPrePattern = /<(?:\w+:)?pre\b/; const strReplacements = { @@ -39,30 +41,30 @@ function isEmptyBundle(resolvedBundle) { } const UI5BundleFormat = { - beforePreloads(outW, section) { - outW.write(`jQuery.sap.registerPreloadedModules(`); - outW.writeln(`{`); + beforePreloads(section) { + let str = `jQuery.sap.registerPreloadedModules({\n`; if ( section.name ) { - outW.writeln(`"name":"${section.name}",`); + str += `"name":"${section.name}",\n`; } - outW.writeln(`"version":"2.0",`); - outW.writeln(`"modules":{`); + str += `"version":"2.0",\n`; + str += `"modules":{\n`; + return str; }, - afterPreloads(outW, section) { - outW.writeln(`}});`); + afterPreloads(section) { + return `}});\n`; }, - beforeBundleInfo(outW) { - outW.writeln("\"unsupported\"; /* 'bundleInfo' section mode not supported (requires ui5loader)"); + beforeBundleInfo() { + return `"unsupported"; /* 'bundleInfo' section mode not supported (requires ui5loader)\n`; }, - afterBundleInfo(outW) { - outW.writeln("*/"); + afterBundleInfo() { + return "*/\n"; }, - requireSync(outW, moduleName) { - outW.writeln(`sap.ui.requireSync("${ModuleName.toRequireJSName(moduleName)}");`); + requireSync(moduleName) { + return `sap.ui.requireSync("${ModuleName.toRequireJSName(moduleName)}");\n`; }, shouldDecorate(resolvedModule) { @@ -71,28 +73,29 @@ const UI5BundleFormat = { }; const EVOBundleFormat = { - beforePreloads(outW, section) { - outW.writeln(`sap.ui.require.preload({`); + beforePreloads(section) { + return `sap.ui.require.preload({\n`; }, - afterPreloads(outW, section) { - outW.write(`}`); + afterPreloads(section) { + let str = `}`; if ( section.name ) { - outW.write(`,"${section.name}"`); + str += `,"${section.name}"`; } - outW.writeln(`);`); + str += `);\n`; + return str; }, - beforeBundleInfo(outW) { - outW.writeln("sap.ui.loader.config({bundlesUI5:{"); + beforeBundleInfo() { + return "sap.ui.loader.config({bundlesUI5:{\n"; }, - afterBundleInfo(outW) { - outW.writeln("}});"); + afterBundleInfo() { + return "}});\n"; }, - requireSync(outW, moduleName) { - outW.writeln(`sap.ui.requireSync("${ModuleName.toRequireJSName(moduleName)}");`); + requireSync(moduleName) { + return `sap.ui.requireSync("${ModuleName.toRequireJSName(moduleName)}");\n`; }, shouldDecorate(resolvedModule) { @@ -146,6 +149,9 @@ class BundleBuilder { this.options = options || {}; this.optimize = !!this.options.optimize; + if (this.options.sourceMap === undefined) { + this.options.sourceMap = true; + } // when decorateBootstrapModule is set to false, we don't write the optimized flag // and don't write the try catch wrapper @@ -155,6 +161,15 @@ class BundleBuilder { // TODO is the following condition ok or should the availability of jquery.sap.global.js be configurable? this.jqglobalAvailable = !resolvedModule.containsGlobal; this.openModule(resolvedModule.name); + + this._sourceMap = { + version: 3, + file: path.posix.basename(resolvedModule.name), + sections: [], + }; + this._bundleName = resolvedModule.name; + this._inlineContentCounter = 0; + let bundleInfos = []; // create all sections in sequence for ( const section of resolvedModule.sections ) { @@ -183,6 +198,7 @@ class BundleBuilder { return { name: module.name, content: this.outW.toString(), + sourceMap: this.options.sourceMap ? JSON.stringify(this._sourceMap) : null, bundleInfo: bundleInfo }; } @@ -200,23 +216,36 @@ class BundleBuilder { } } + writeWithSourceMap(content) { + const transientSourceName = + `${path.posix.basename(this._bundleName)}?bundle-code-${this._inlineContentCounter++}`; + const sourceMap = createTransientSourceMap({ + moduleName: transientSourceName, + moduleContent: content, + includeContent: true + }); + this.addSourceMap(this._bundleName, sourceMap); + this.outW.write(content); + this.outW.ensureNewLine(); + } + closeModule(resolvedModule) { if ( resolvedModule.containsCore ) { this.outW.ensureNewLine(); // for clarity and to avoid issues with single line comments - this.outW.writeln(`// as this module contains the Core, we ensure that the Core has been booted`); - this.outW.writeln(`sap.ui.getCore().boot && sap.ui.getCore().boot();`); + this.writeWithSourceMap( + `// as this module contains the Core, we ensure that the Core has been booted\n` + + `sap.ui.getCore().boot && sap.ui.getCore().boot();`); } if ( this.shouldDecorate && this.options.addTryCatchRestartWrapper ) { this.outW.ensureNewLine(); // for clarity and to avoid issues with single line comments - this.outW.writeln(`} catch(oError) {`); - this.outW.writeln(`if (oError.name != "Restart") { throw oError; }`); - this.outW.writeln(`}`); + this.writeWithSourceMap( + `} catch(oError) {\n` + + `if (oError.name != "Restart") { throw oError; }\n` + + `}`); + } + if (this.options.sourceMap) { + this.outW.writeln(`//# sourceMappingURL=${path.posix.basename(resolvedModule.name)}.map`); } - /* NODE-TODO - if ( writeSourceMap && writeSourceMapAnnotation ) { - outW.ensureNewLine(); - outW.write("//# sourceMappingURL=" + moduleName.getBaseName().replaceFirst("\\.js$", ".js.map")); - }*/ } addSection(section) { @@ -258,31 +287,43 @@ class BundleBuilder { // TODO check that there are only JS modules contained async writeRaw(section) { // write all modules in sequence - for ( const module of section.modules ) { - const resource = await this.pool.findResourceWithInfo(module); + for ( const moduleName of section.modules ) { + const resource = await this.pool.findResourceWithInfo(moduleName); if ( resource != null ) { - this.outW.startSegment(module); + this.outW.startSegment(moduleName); this.outW.ensureNewLine(); - this.outW.writeln("//@ui5-bundle-raw-include " + module); - await this.writeRawModule(module, resource); + this.outW.writeln("//@ui5-bundle-raw-include " + moduleName); + await this.writeRawModule(moduleName, resource); const compressedSize = this.outW.endSegment(); - log.verbose(" %s (%d,%d)", module, resource.info != null ? resource.info.size : -1, compressedSize); + log.verbose(" %s (%d,%d)", moduleName, + resource.info != null ? resource.info.size : -1, compressedSize); if ( section.declareRawModules ) { - this.missingRawDeclarations.push(module); + this.missingRawDeclarations.push(moduleName); } - if ( module === UI5ClientConstants.MODULE__JQUERY_SAP_GLOBAL ) { + if ( moduleName === UI5ClientConstants.MODULE__JQUERY_SAP_GLOBAL ) { this.jqglobalAvailable = true; } } else { - log.error(" couldn't find %s", module); + log.error(" couldn't find %s", moduleName); } } } - async writeRawModule(module, resource) { - const fileContent = await resource.string(); + async writeRawModule(moduleName, resource) { + this.outW.ensureNewLine(); + let moduleContent = (await resource.buffer()).toString(); + if (this.options.sourceMap) { + let moduleSourceMap; + ({moduleContent, moduleSourceMap} = + await this.getSourceMapForModule({ + moduleName, + moduleContent, + resourcePath: resource.getPath() + })); + this.addSourceMap(moduleName, moduleSourceMap); + } + this.outW.write(moduleContent); this.outW.ensureNewLine(); - this.outW.write(fileContent); } async writePreloadFunction(section) { @@ -296,7 +337,7 @@ class BundleBuilder { await this.rewriteAMDModules(sequence); if ( sequence.length > 0 ) { - this.targetBundleFormat.beforePreloads(outW, section); + this.writeWithSourceMap(this.targetBundleFormat.beforePreloads(section)); let i = 0; for ( const module of sequence ) { const resource = await this.pool.findResourceWithInfo(module); @@ -304,7 +345,7 @@ class BundleBuilder { if ( i>0 ) { outW.writeln(","); } - this.beforeWritePreloadModule(module, resource.info, resource); + // this.beforeWritePreloadModule(module, resource.info, resource); outW.write(`\t"${module.toString()}":`); outW.startSegment(module); await this.writePreloadModule(module, resource.info, resource); @@ -320,7 +361,7 @@ class BundleBuilder { if ( i > 0 ) { outW.writeln(); } - this.targetBundleFormat.afterPreloads(outW, section); + outW.write(this.targetBundleFormat.afterPreloads(section)); } // this.afterWriteFunctionPreloadSection(); @@ -331,32 +372,72 @@ class BundleBuilder { sequence.sort(); } + addSourceMap(moduleName, map) { + if (!map) { + throw new Error("No source map provided"); + } + + if (map.mappings.startsWith(";")) { + // If first line is not already mapped (typical for comments or parentheses), add a mapping to + // make sure that dev-tools (especially Chrome's) don't choose the end of the preceding module + // when the user tries to set a breakpoint from the bundle file + map.mappings = "AAAA" + map.mappings; + } + + map.sourceRoot = path.posix.relative( + path.posix.dirname(this._bundleName), path.posix.dirname(moduleName)); + + this._sourceMap.sections.push({ + offset: { + line: this.outW.lineOffset, + column: this.outW.columnOffset + }, + map + }); + } + async rewriteAMDModules(sequence) { if ( this.options.usePredefineCalls ) { const outW = this.outW; const remaining = []; - for ( const module of sequence ) { - if ( /\.js$/.test(module) ) { - // console.log("Processing " + module); - const resource = await this.pool.findResourceWithInfo(module); - let moduleContent = await resource.string(); - moduleContent = rewriteDefine(this.targetBundleFormat, moduleContent, module); - if ( moduleContent ) { - outW.startSegment(module); + for ( const moduleName of sequence ) { + if ( /\.js$/.test(moduleName) ) { + // console.log("Processing " + moduleName); + const resource = await this.pool.findResourceWithInfo(moduleName); + let moduleContent = (await resource.buffer()).toString(); + let moduleSourceMap; + if (this.options.sourceMap) { + ({moduleContent, moduleSourceMap} = + await this.getSourceMapForModule({ + moduleName, + moduleContent, + resourcePath: resource.getPath() + })); + } + + const rewriteRes = await rewriteDefine({ + moduleName, moduleContent, moduleSourceMap + }); + if (rewriteRes) { + const {moduleContent, moduleSourceMap} = rewriteRes; + outW.startSegment(moduleName); outW.ensureNewLine(); + if (moduleSourceMap) { + this.addSourceMap(moduleName, moduleSourceMap); + } outW.write(moduleContent); outW.ensureNewLine(); const compressedSize = outW.endSegment(); - log.verbose(" %s (%d,%d)", module, + log.verbose(" %s (%d,%d)", moduleName, resource.info != null ? resource.info.size : -1, compressedSize); } else { // keep unprocessed modules - remaining.push(module); + remaining.push(moduleName); } } else { // keep unprocessed modules - remaining.push(module); + remaining.push(moduleName); } } @@ -372,42 +453,54 @@ class BundleBuilder { /** * - * @param {string} module module name + * @param {string} moduleName module name * @param {ModuleInfo} info * @param {module:@ui5/fs.Resource} resource * @returns {Promise} */ - async writePreloadModule(module, info, resource) { + async writePreloadModule(moduleName, info, resource) { const outW = this.outW; - if ( /\.js$/.test(module) && (info == null || !info.requiresTopLevelScope) ) { - const moduleContent = await resource.string(); - outW.write(`function(){`); + if ( /\.js$/.test(moduleName) && (info == null || !info.requiresTopLevelScope) ) { + outW.writeln(`function(){`); + // The module should be written to a new line in order for dev-tools to map breakpoints to it + outW.ensureNewLine(); + let moduleContent = (await resource.buffer()).toString(); + if (this.options.sourceMap) { + let moduleSourceMap; + ({moduleContent, moduleSourceMap} = + await this.getSourceMapForModule({ + moduleName, + moduleContent, + resourcePath: resource.getPath() + })); + + this.addSourceMap(moduleName, moduleSourceMap); + } outW.write(moduleContent); this.exportGlobalNames(info); outW.ensureNewLine(); outW.write(`}`); - } else if ( /\.js$/.test(module) /* implicitly: && info != null && info.requiresTopLevelScope */ ) { + } else if ( /\.js$/.test(moduleName) /* implicitly: && info != null && info.requiresTopLevelScope */ ) { log.warn("**** warning: module %s requires top level scope" + - " and can only be embedded as a string (requires 'eval')", module); - const moduleContent = await resource.buffer(); - outW.write(makeStringLiteral(moduleContent)); - } else if ( /\.html$/.test(module) ) { - const fileContent = await resource.buffer(); + " and can only be embedded as a string (requires 'eval')", moduleName); + outW.write( makeStringLiteral( (await resource.buffer()).toString() ) ); + } else if ( /\.html$/.test(moduleName) ) { + const fileContent = (await resource.buffer()).toString(); outW.write( makeStringLiteral( fileContent ) ); - } else if ( /\.json$/.test(module) ) { - let fileContent = await resource.buffer(); + } else if ( /\.json$/.test(moduleName) ) { + let fileContent = (await resource.buffer()).toString(); if ( this.optimize ) { try { fileContent = JSON.stringify( JSON.parse( fileContent) ); } catch (e) { - log.verbose("Failed to parse JSON file %s. Ignoring error, skipping compression.", module); + log.verbose("Failed to parse JSON file %s. Ignoring error, skipping compression.", moduleName); log.verbose(e); } } outW.write(makeStringLiteral(fileContent)); - } else if ( /\.xml$/.test(module) ) { - let fileContent = await resource.string(); + } else if ( /\.xml$/.test(moduleName) ) { + let fileContent = (await resource.buffer()).toString(); if ( this.optimize ) { // For XML we use the pretty data // Do not minify if XML(View) contains an <*:pre> tag, @@ -417,14 +510,14 @@ class BundleBuilder { } } outW.write( makeStringLiteral( fileContent ) ); - } else if ( /\.properties$/.test(module) ) { + } else if ( /\.properties$/.test(moduleName) ) { // Since the Builder is also used when building non-project resources (e.g. dependencies) // *.properties files should be escaped if encoding option is specified const fileContent = await escapePropertiesFile(resource); outW.write( makeStringLiteral( fileContent ) ); } else { - log.error("don't know how to embed module " + module); // TODO throw? + log.error("don't know how to embed module " + moduleName); // TODO throw? } return true; @@ -442,18 +535,19 @@ class BundleBuilder { this.outW.ensureNewLine(); info.exposedGlobals.forEach( (globalName) => { // Note: globalName can be assumed to be a valid identifier as it is used as variable name anyhow - this.outW.writeln(`this.${globalName}=${globalName};`); + this.writeWithSourceMap(`this.${globalName}=${globalName};\n`); }); } writeBundleInfos(sections) { this.outW.ensureNewLine(); + let bundleInfoStr = ""; if ( sections.length > 0 ) { - this.targetBundleFormat.beforeBundleInfo(this.outW); + bundleInfoStr = this.targetBundleFormat.beforeBundleInfo(); sections.forEach((section, idx) => { if ( idx > 0 ) { - this.outW.writeln(","); + bundleInfoStr += ",\n"; } if (!section.name) { @@ -464,31 +558,116 @@ class BundleBuilder { `The info might not work as expected. ` + `The name must match the bundle filename (incl. extension such as '.js')`); } - this.outW.write(`"${section.name}":[${section.modules.map(makeStringLiteral).join(",")}]`); + bundleInfoStr += `"${section.name}":[${section.modules.map(makeStringLiteral).join(",")}]`; }); - this.outW.writeln(); - this.targetBundleFormat.afterBundleInfo(this.outW); + bundleInfoStr += "\n"; + bundleInfoStr += this.targetBundleFormat.afterBundleInfo(); + + this.writeWithSourceMap(bundleInfoStr); } } writeRequires(section) { this.outW.ensureNewLine(); section.modules.forEach( (module) => { - this.targetBundleFormat.requireSync(this.outW, module); + this.writeWithSourceMap(this.targetBundleFormat.requireSync(module)); }); } + + async getSourceMapForModule({moduleName, moduleContent, resourcePath}) { + let moduleSourceMap = null; + let newModuleContent = moduleContent; + + const sourceMapUrlMatch = moduleContent.match(sourceMappingUrlPattern); + if (sourceMapUrlMatch) { + const sourceMapUrl = sourceMapUrlMatch[1]; + log.verbose(`Found source map reference in content of module ${moduleName}: ${sourceMapUrl}`); + + // Strip sourceMappingURL from module code to be bundled + // It has no effect and might be cause for confusion + newModuleContent = moduleContent.replace(sourceMappingUrlPattern, ""); + + if (sourceMapUrl) { + if (sourceMapUrl.startsWith("data:")) { + // Data-URI indicates an inline source map + const expectedTypeAndEncoding = "data:application/json;charset=utf-8;base64,"; + if (sourceMapUrl.startsWith(expectedTypeAndEncoding)) { + const base64Content = sourceMapUrl.slice(expectedTypeAndEncoding.length); + moduleSourceMap = Buffer.from(base64Content, "base64").toString(); + } else { + log.warn( + `Source map reference in module ${moduleName} is a data URI but has an unexpected` + + `encoding: ${sourceMapUrl}. Expected it to start with ` + + `"data:application/json;charset=utf-8;base64,"`); + } + } else if (httpPattern.test(sourceMapUrl)) { + log.warn(`Source map reference in module ${moduleName} is an absolute URL. ` + + `Currently, only relative URLs are supported.`); + } else if (path.posix.isAbsolute(sourceMapUrl)) { + log.warn(`Source map reference in module ${moduleName} is an absolute path. ` + + `Currently, only relative paths are supported.`); + } else { + const sourceMapPath = path.posix.join(path.posix.dirname(moduleName), sourceMapUrl); + + try { + const sourceMapResource = await this.pool.findResource(sourceMapPath); + moduleSourceMap = (await sourceMapResource.buffer()).toString(); + } catch (e) { + // No input source map + log.warn(`Unable to read source map for module ${moduleName}: ${e.message}`); + } + } + } + } else { + const sourceMapFileCandidate = resourcePath.slice("/resources/".length) + ".map"; + log.verbose(`Could not find a sourceMappingURL reference in content of module ${moduleName}. ` + + `Attempting to find a source map resource based on the module's path: ${sourceMapFileCandidate}`); + try { + const sourceMapResource = await this.pool.findResource(sourceMapFileCandidate); + if (sourceMapResource) { + moduleSourceMap = (await sourceMapResource.buffer()).toString(); + } + } catch (e) { + // No input source map + log.verbose(`Could not find a source map for module ${moduleName}: ${e.message}`); + } + } + + + if (moduleSourceMap) { + moduleSourceMap = JSON.parse(moduleSourceMap); + } else { + log.verbose(`No source map available for module ${moduleName}. Creating transient source map...`); + moduleSourceMap = createTransientSourceMap({ + moduleName: path.posix.basename(resourcePath), + moduleContent + }); + } + + return { + moduleSourceMap, + moduleContent: newModuleContent + }; + } } const CALL_SAP_UI_DEFINE = ["sap", "ui", "define"]; -function rewriteDefine(targetBundleFormat, code, moduleName) { +/* + * @param {object} parameters + * @param {string} parameters.moduleName + * @param {string} parameters.moduleContent + * @param {object} [parameters.moduleSourceMap] + * @returns {Promise} Object containing moduleContent and + * moduleSourceMap (if one was provided) or null if no rewrite was applicable + */ +async function rewriteDefine({moduleName, moduleContent, moduleSourceMap}) { let ast; - const codeStr = code.toString(); try { - ast = parseJS(codeStr, {range: true}); + ast = parseJS(moduleContent, {range: true}); } catch (e) { log.error("error while parsing %s: %s", moduleName, e.message); - return; + return {}; } if ( ast.type === Syntax.Program && @@ -497,7 +676,6 @@ function rewriteDefine(targetBundleFormat, code, moduleName) { const changes = []; const defineCall = ast.body[0].expression; - // Inject module name if missing if ( defineCall.arguments.length == 0 || defineCall.arguments[0].type !== Syntax.Literal ) { @@ -515,7 +693,6 @@ function rewriteDefine(targetBundleFormat, code, moduleName) { changes.push({ index, - count: 0, value }); } @@ -527,29 +704,109 @@ function rewriteDefine(targetBundleFormat, code, moduleName) { changes.push({ // asterisk marks the index: sap.ui.*define() index: defineCall.callee.property.range[0], - count: 0, value: "pre" }); } - return applyChanges(codeStr, changes); + return transform(changes, moduleContent, moduleSourceMap); } - return false; + return null; } -function applyChanges(string, changes) { - // No sorting needed as changes are added in correct order - - const array = Array.from(string); +/* + * @param {object[]} changes Changes that should be applied to the code + * @param {string} moduleContent Code to transform + * @param {object} [moduleSourceMap] Optional source map that should be aligned with the content change + * @returns {Promise} Object containing moduleContent and + * moduleSourceMap (if one was provided) + */ +async function transform(changes, moduleContent, moduleSourceMap) { + const mappingChanges = []; + + const array = Array.from(moduleContent); + // No sorting needed as changes are added in correct (reverse) order changes.forEach((change) => { + if (moduleSourceMap) { + // Compute line and column for given index to re-align source map with inserted characters + const precedingCode = array.slice(0, change.index); + + const line = precedingCode.reduce((lineCount, char) => { + if (char === "\n") { + lineCount++; + } + return lineCount; + }, 0); + const lineStartIndex = precedingCode.lastIndexOf("\n") + 1; + const column = change.index - lineStartIndex; + + // Source map re-alignment needs to be done from front to back + mappingChanges.unshift({ + line, + column, + columnDiff: change.value.length + }); + } + + // Apply modification array.splice( change.index, - change.count, + 0, change.value ); }); - return array.join(""); + const transformedCode = array.join(""); + + if (moduleSourceMap) { + const mappings = decodeMappings(moduleSourceMap.mappings); + mappingChanges.forEach((mappingChange) => { + const lineMapping = mappings[mappingChange.line]; + if (!lineMapping) { + // No mapping available that could be transformed + return; + } + // Mapping structure: + // [generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex] + lineMapping.forEach((mapping) => { + if (mapping[0] > mappingChange.column) { + // All column mappings for the generated code after any change + // need to be moved by the amount of inserted characters + mapping[0] = mapping[0] + mappingChange.columnDiff; + } + }); + }); + + moduleSourceMap.mappings = encodeMappings(mappings); + + // No need for file information in source map since the bundled code does not exist in any file anyways + delete moduleSourceMap.file; + } + + return { + moduleContent: transformedCode, + moduleSourceMap + }; +} + +function createTransientSourceMap({moduleName, moduleContent, includeContent = false}) { + const sourceMap = { + version: 3, + sources: [moduleName], + // TODO: check whether moduleContent.match() with \n is better w.r.t performance/memory usage + mappings: encodeMappings(moduleContent.split("\n").map((line, i) => { + return [[0, 0, i, 0]]; + })) + }; + if (includeContent) { + sourceMap.sourcesContent = [moduleContent]; + } + return sourceMap; } module.exports = BundleBuilder; + +// Export local functions for testing only +/* istanbul ignore else */ +if (process.env.NODE_ENV === "test") { + module.exports.__localFunctions__ = {rewriteDefine, createTransientSourceMap}; +} diff --git a/lib/lbt/bundle/BundleWriter.js b/lib/lbt/bundle/BundleWriter.js index 8b63ba0ad..004bc9311 100644 --- a/lib/lbt/bundle/BundleWriter.js +++ b/lib/lbt/bundle/BundleWriter.js @@ -11,6 +11,8 @@ const SPACES_OR_TABS_ONLY = /^[ \t]+$/; * * Most methods have been extracted from JSMergeWriter. * + * columnOffset and lineOffset are used for sourcemap merging as reference to where we are at a given point in time + * * @author Frank Weigel * @since 1.27.0 * @private @@ -18,6 +20,8 @@ const SPACES_OR_TABS_ONLY = /^[ \t]+$/; class BundleWriter { constructor() { this.buf = ""; + this.lineOffset = 0; + this.columnOffset = 0; this.segments = []; this.currentSegment = null; this.currentSourceIndex = 0; @@ -28,6 +32,11 @@ class BundleWriter { let writeBuf = ""; for ( let i = 0; i < str.length; i++ ) { writeBuf += str[i]; + if (str[i] != null && str[i].split) { + const strSplit = str[i].split(NL); + this.lineOffset += strSplit.length - 1; + this.columnOffset += strSplit[strSplit.length - 1].length; + } } if ( writeBuf.length >= 1 ) { this.buf += writeBuf; @@ -40,15 +49,23 @@ class BundleWriter { writeln(...str) { for ( let i = 0; i < str.length; i++ ) { this.buf += str[i]; + if (str[i] != null && str[i].split) { + const strSplit = str[i].split(NL); + this.lineOffset += strSplit.length - 1; + } } this.buf += NL; this.endsWithNewLine = true; + this.lineOffset += 1; + this.columnOffset = 0; } ensureNewLine() { if ( !this.endsWithNewLine ) { this.buf += NL; this.endsWithNewLine = true; + this.lineOffset += 1; + this.columnOffset = 0; } } diff --git a/lib/lbt/resources/LocatorResource.js b/lib/lbt/resources/LocatorResource.js index a5c029734..a39fbb37e 100644 --- a/lib/lbt/resources/LocatorResource.js +++ b/lib/lbt/resources/LocatorResource.js @@ -1,12 +1,12 @@ const Resource = require("./Resource"); -function extractName(path) { - return path.slice( "/resources/".length); -} +// function extractName(path) { +// return path.slice( "/resources/".length); +// } class LocatorResource extends Resource { - constructor(pool, resource) { - super(pool, extractName(resource.getPath()), null, resource.getStatInfo()); + constructor(pool, resource, moduleName) { + super(pool, moduleName, null, resource.getStatInfo()); this.resource = resource; } @@ -17,6 +17,10 @@ class LocatorResource extends Resource { getProject() { return this.resource._project; } + + getPath() { + return this.resource.getPath(); + } } module.exports = LocatorResource; diff --git a/lib/lbt/resources/LocatorResourcePool.js b/lib/lbt/resources/LocatorResourcePool.js index 104051584..af6994c17 100644 --- a/lib/lbt/resources/LocatorResourcePool.js +++ b/lib/lbt/resources/LocatorResourcePool.js @@ -2,12 +2,16 @@ const ResourcePool = require("./ResourcePool"); const LocatorResource = require("./LocatorResource"); class LocatorResourcePool extends ResourcePool { - prepare(resources) { + prepare(resources, moduleNameMapping) { resources = resources.filter( (res) => !res.getStatInfo().isDirectory() ); return Promise.all( - resources.map( - (resource) => this.addResource( new LocatorResource(this, resource) ) - ).filter(Boolean) + resources.map((resource) => { + let moduleName = moduleNameMapping && moduleNameMapping[resource.getPath()]; + if (!moduleName) { + moduleName = resource.getPath().slice("/resources/".length); + } + this.addResource(new LocatorResource(this, resource, moduleName)); + }).filter(Boolean) ); } } diff --git a/lib/processors/bundlers/moduleBundler.js b/lib/processors/bundlers/moduleBundler.js index f1a205492..e4080b2df 100644 --- a/lib/processors/bundlers/moduleBundler.js +++ b/lib/processors/bundlers/moduleBundler.js @@ -90,6 +90,8 @@ const log = require("@ui5/logger").getLogger("builder:processors:bundlers:module * @public * @typedef {object} ModuleBundleOptions * @property {boolean} [optimize=true] Whether the module bundle gets minified + * @property {boolean} [sourceMap] Whether to generate a source map file for the bundle. + * Defaults to true if optimize is set to true * @property {boolean} [decorateBootstrapModule=false] If set to 'false', the module won't be decorated * with an optimization marker * @property {boolean} [addTryCatchRestartWrapper=false] Whether to wrap bootable module bundles with @@ -101,18 +103,30 @@ const log = require("@ui5/logger").getLogger("builder:processors:bundlers:module */ /** - * Legacy preload bundler. + * Result set + * + * @public + * @typedef {object} ModuleBundlerResult + * @property {module:@ui5/fs.Resource} bundle Bundle resource + * @property {module:@ui5/fs.Resource} sourceMap Source Map + * @memberof module:@ui5/builder.processors + */ + +/** + * Legacy module bundler. * * @public * @alias module:@ui5/builder.processors.moduleBundler * @param {object} parameters Parameters * @param {module:@ui5/fs.Resource[]} parameters.resources Resources * @param {object} parameters.options Options + * @param {object} [parameters.options.moduleNameMapping] + Optional mapping of resource paths to module name in order to overwrite the default determination * @param {ModuleBundleDefinition} parameters.options.bundleDefinition Module bundle definition * @param {ModuleBundleOptions} [parameters.options.bundleOptions] Module bundle options - * @returns {Promise} Promise resolving with module bundle resources + * @returns {Promise} Promise resolving with module bundle resources */ -module.exports = function({resources, options: {bundleDefinition, bundleOptions}}) { +module.exports = function({resources, options: {bundleDefinition, bundleOptions, moduleNameMapping}}) { // Apply defaults without modifying the passed object bundleOptions = Object.assign({}, { optimize: true, @@ -134,7 +148,7 @@ module.exports = function({resources, options: {bundleDefinition, bundleOptions} log.verbose(`bundleOptions: ${JSON.stringify(bundleOptions, null, 2)}`); } - return pool.prepare( resources ). + return pool.prepare( resources, moduleNameMapping ). then( () => builder.createBundle(bundleDefinition, bundleOptions) ). then( (results) => { let bundles; @@ -146,13 +160,20 @@ module.exports = function({resources, options: {bundleDefinition, bundleOptions} return Promise.all(bundles.map((bundleObj) => { if ( bundleObj ) { - const {name, content} = bundleObj; + const {name, content, sourceMap} = bundleObj; // console.log("creating bundle as '%s'", "/resources/" + name); - const resource = new EvoResource({ + const res = {}; + res.bundle = new EvoResource({ path: "/resources/" + name, string: content }); - return resource; + if (sourceMap) { + res.sourceMap = new EvoResource({ + path: "/resources/" + name + ".map", + string: sourceMap + }); + } + return res; } })); }); diff --git a/lib/processors/minifier.js b/lib/processors/minifier.js index e2abe32d8..1a583fd23 100644 --- a/lib/processors/minifier.js +++ b/lib/processors/minifier.js @@ -34,10 +34,12 @@ const debugFileRegex = /((?:\.view|\.fragment|\.controller|\.designtime|\.suppor * @alias module:@ui5/builder.processors.minifier * @param {object} parameters Parameters * @param {module:@ui5/fs.Resource[]} parameters.resources List of resources to be processed + * @param {boolean} [parameters.addSourceMappingUrl=true] + * Whether to add a sourceMappingURL reference to the end of the minified resource * @returns {Promise} * Promise resolving with object of resource, dbgResource and sourceMap */ -module.exports = async function({resources}) { +module.exports = async function({resources, addSourceMappingUrl = true}) { return Promise.all(resources.map(async (resource) => { const dbgPath = resource.getPath().replace(debugFileRegex, "-dbg$1"); const dbgResource = await resource.clone(); @@ -46,6 +48,12 @@ module.exports = async function({resources}) { const filename = path.posix.basename(resource.getPath()); const code = await resource.getString(); try { + const sourceMapOptions = { + filename + }; + if (addSourceMappingUrl) { + sourceMapOptions.url = filename + ".map"; + } const dbgFilename = path.posix.basename(dbgPath); const result = await terser.minify({ // Use debug-name since this will be referenced in the source map "sources" @@ -63,10 +71,7 @@ module.exports = async function({resources}) { "sap", ] }, - sourceMap: { - filename, - url: filename + ".map" - } + sourceMap: sourceMapOptions }); resource.setString(result.code); const sourceMapResource = new Resource({ diff --git a/lib/tasks/bundlers/generateBundle.js b/lib/tasks/bundlers/generateBundle.js index 2b0360180..2d83d1f43 100644 --- a/lib/tasks/bundlers/generateBundle.js +++ b/lib/tasks/bundlers/generateBundle.js @@ -25,8 +25,53 @@ module.exports = function({ readers: [workspace, dependencies] }); + const optimize = !bundleOptions || bundleOptions.optimize !== false; if (taskUtil) { - const optimize = !bundleOptions || bundleOptions.optimize !== false; + /* Scenarios + 1. Optimize bundle with minification already done + Workspace: + * /resources/my/lib/Control.js [ui5:HasDebugVariant] + * /resources/my/lib/Control.js.map [ui5:HasDebugVariant] + * /resources/my/lib/Control-dbg.js [ui5:IsDebugVariant] + + Bundler input: + * /resources/my/lib/Control.js + * /resources/my/lib/Control.js.map + + => Filter out debug resources + + 2. Optimize bundle with no minification + * /resources/my/lib/Control.js + + => No action necessary + + 3. Debug-bundle with minification already done + Workspace: + * /resources/my/lib/Control.js [ui5:HasDebugVariant] + * /resources/my/lib/Control.js.map [ui5:HasDebugVariant] + * /resources/my/lib/Control-dbg.js [ui5:IsDebugVariant] + + Bundler input: + * /resources/my/lib/Control-dbg.js + * moduleNameMapping: [{"/resources/my/lib/Control-dbg.js": "my/lib/Control.js"}] + + => Filter out minified-resources (tagged as "HasDebugVariant", incl. source maps) and rename debug-files + + 4. Debug-bundle with no minification + * /resources/my/lib/Control.js + + => No action necessary + + 5. Bundle with external input (optimize or not), e.g. TS-project + Workspace: + * /resources/my/lib/Control.ts + * /resources/my/lib/Control.js + * /resources/my/lib/Control.js.map + + Bundler input: + * /resources/my/lib/Control.js + * /resources/my/lib/Control.js.map + */ // Omit -dbg files for optimize bundles and vice versa const filterTag = optimize ? @@ -34,37 +79,50 @@ module.exports = function({ combo = combo.filter(function(resource) { return !taskUtil.getTag(resource, filterTag); }); + } - if (!optimize) { - // For "unoptimized" bundles, the non-debug files have already been filtered out - // Now rename the debug variants to the same name so that they appear like the original - // resource to the bundler - combo = combo.transformer(async function(resourcePath, getResource) { + return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}").then((resources) => { + const moduleNameMapping = {}; + if (!optimize && taskUtil) { + // For "unoptimized" bundles, the non-debug files have already been filtered out above. + // Now we need to create a mapping from the debug-variant resource path to the respective module name, + // which is basically the non-debug resource path, minus the "/resources/"" prefix. + // This mapping overwrites internal logic of the LocatorResourcePool which would otherwise determine + // the module name from the resource path, which would contain "-dbg" in this case. That would be + // incorrect since debug-variants should still keep the original module name. + for (let i = resources.length - 1; i >= 0; i--) { + const resourcePath = resources[i].getPath(); if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) { - const resource = await getResource(); - const nonDbgPath = ModuleName.getNonDebugName(resource.getPath()); + const nonDbgPath = ModuleName.getNonDebugName(resourcePath); if (!nonDbgPath) { - throw new Error(`Failed to resolve non-debug name for ${resource.getPath()}`); + throw new Error(`Failed to resolve non-debug name for ${resourcePath}`); } - resource.setPath(nonDbgPath); + moduleNameMapping[resourcePath] = nonDbgPath.slice("/resources/".length); } - }); + } } - } - - return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library}").then((resources) => { return moduleBundler({ options: { bundleDefinition, - bundleOptions + bundleOptions, + moduleNameMapping }, resources }).then((bundles) => { - return Promise.all(bundles.map((bundle) => { + return Promise.all(bundles.map(({bundle, sourceMap}) => { if (taskUtil) { taskUtil.setTag(bundle, taskUtil.STANDARD_TAGS.IsBundle); + if (sourceMap) { + // Clear tag that might have been set by the minify task, in cases where + // the bundle name is identical to a source file + taskUtil.clearTag(sourceMap, taskUtil.STANDARD_TAGS.OmitFromBuildResult); + } + } + const writes = [workspace.write(bundle)]; + if (sourceMap) { + writes.push(workspace.write(sourceMap)); } - return workspace.write(bundle); + return Promise.all(writes); })); }); }); diff --git a/lib/tasks/bundlers/generateComponentPreload.js b/lib/tasks/bundlers/generateComponentPreload.js index 4946624b0..0bae96d79 100644 --- a/lib/tasks/bundlers/generateComponentPreload.js +++ b/lib/tasks/bundlers/generateComponentPreload.js @@ -41,7 +41,7 @@ module.exports = function({ } // TODO 3.0: Limit to workspace resources? - return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library}") + return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}") .then(async (resources) => { let allNamespaces = []; if (paths) { @@ -148,12 +148,19 @@ module.exports = function({ }); })); }) - .then((processedResources) => { - return Promise.all(processedResources.map((resource) => { + .then((results) => { + const bundles = Array.prototype.concat.apply([], results); + return Promise.all(bundles.map(({bundle, sourceMap}) => { if (taskUtil) { - taskUtil.setTag(resource[0], taskUtil.STANDARD_TAGS.IsBundle); + taskUtil.setTag(bundle, taskUtil.STANDARD_TAGS.IsBundle); + // Clear tag that might have been set by the minify task, in cases where + // the bundle name is identical to a source file + taskUtil.clearTag(sourceMap, taskUtil.STANDARD_TAGS.OmitFromBuildResult); } - return workspace.write(resource[0]); + return Promise.all([ + workspace.write(bundle), + workspace.write(sourceMap) + ]); })); }); }; diff --git a/lib/tasks/bundlers/generateLibraryPreload.js b/lib/tasks/bundlers/generateLibraryPreload.js index 5a6b5bba2..654aa65ca 100644 --- a/lib/tasks/bundlers/generateLibraryPreload.js +++ b/lib/tasks/bundlers/generateLibraryPreload.js @@ -177,6 +177,8 @@ function createLibraryBundles(libraryNamespace, resources, excludes) { ignoreMissingModules: true, skipIfEmpty: true } + // Note: Although the bundle uses optimize=false, there is + // no moduleNameMapping needed, as support files are excluded from minification. }, resources }) @@ -212,6 +214,10 @@ function getModuleBundlerOptions(config) { moduleBundlerOptions.bundleDefinition.sections.unshift(providedSection); } + if (config.moduleNameMapping) { + moduleBundlerOptions.moduleNameMapping = config.moduleNameMapping; + } + return moduleBundlerOptions; } @@ -285,7 +291,7 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN }); } - return combo.byGlob("/**/*.{js,json,xml,html,properties,library}").then(async (resources) => { + return combo.byGlob("/**/*.{js,json,xml,html,properties,library,js.map}").then(async (resources) => { // Find all libraries and create a library-preload.js bundle let p = Promise.resolve(); @@ -305,6 +311,7 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN return resource.getPath() === "/resources/ui5loader.js"; }); + const unoptimizedModuleNameMapping = {}; let unoptimizedResources = resources; if (taskUtil) { unoptimizedResources = await new ReaderCollectionPrioritized({ @@ -313,16 +320,24 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN }).filter(function(resource) { // Remove any non-debug variants return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant); - }).transformer(async function(resourcePath, getResource) { + }).byGlob("/**/*.{js,json,xml,html,properties,library,js.map}"); + + // For "unoptimized" bundles, the non-debug files have already been filtered out above. + // Now we need to create a mapping from the debug-variant resource path to the respective module + // name, which is basically the non-debug resource path, minus the "/resources/"" prefix. + // This mapping overwrites internal logic of the LocatorResourcePool which would otherwise determine + // the module name from the resource path, which would contain "-dbg" in this case. That would be + // incorrect since debug-variants should still keep the original module name. + for (let i = unoptimizedResources.length - 1; i >= 0; i--) { + const resourcePath = unoptimizedResources[i].getPath(); if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) { - const resource = await getResource(); - const nonDbgPath = ModuleName.getNonDebugName(resource.getPath()); + const nonDbgPath = ModuleName.getNonDebugName(resourcePath); if (!nonDbgPath) { - throw new Error(`Failed to resolve non-debug name for ${resource.getPath()}`); + throw new Error(`Failed to resolve non-debug name for ${resourcePath}`); } - resource.setPath(nonDbgPath); + unoptimizedModuleNameMapping[resourcePath] = nonDbgPath.slice("/resources/".length); } - }).byGlob("/**/*.{js,json,xml,html,properties,library}"); + } } let filters; @@ -337,7 +352,10 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN resources }), moduleBundler({ - options: getModuleBundlerOptions({name: "sap-ui-core-dbg.js", filters, preload: false}), + options: getModuleBundlerOptions({ + name: "sap-ui-core-dbg.js", filters, preload: false, + moduleNameMapping: unoptimizedModuleNameMapping + }), resources: unoptimizedResources }), moduleBundler({ @@ -348,17 +366,27 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN }), moduleBundler({ options: getModuleBundlerOptions({ - name: "sap-ui-core-nojQuery-dbg.js", filters, preload: false, provided: true + name: "sap-ui-core-nojQuery-dbg.js", filters, preload: false, provided: true, + moduleNameMapping: unoptimizedModuleNameMapping }), resources: unoptimizedResources }), ]).then((results) => { const bundles = Array.prototype.concat.apply([], results); - return Promise.all(bundles.map((bundle) => { + return Promise.all(bundles.map(({bundle, sourceMap}) => { if (taskUtil) { taskUtil.setTag(bundle, taskUtil.STANDARD_TAGS.IsBundle); + if (sourceMap) { + // Clear tag that might have been set by the minify task, in cases where + // the bundle name is identical to a source file + taskUtil.clearTag(sourceMap, taskUtil.STANDARD_TAGS.OmitFromBuildResult); + } } - return workspace.write(bundle); + const writes = [workspace.write(bundle)]; + if (sourceMap) { + writes.push(workspace.write(sourceMap)); + } + return Promise.all(writes); })); }); } @@ -396,12 +424,22 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN return createLibraryBundles(libraryNamespace, resources, excludes) .then((results) => { const bundles = Array.prototype.concat.apply([], results); - return Promise.all(bundles.map((bundle) => { + return Promise.all(bundles.map(({bundle, sourceMap} = {}) => { if (bundle) { if (taskUtil) { taskUtil.setTag(bundle, taskUtil.STANDARD_TAGS.IsBundle); + if (sourceMap) { + // Clear tag that might have been set by the minify task, in cases where + // the bundle name is identical to a source file + taskUtil.clearTag(sourceMap, + taskUtil.STANDARD_TAGS.OmitFromBuildResult); + } + } + const writes = [workspace.write(bundle)]; + if (sourceMap) { + writes.push(workspace.write(sourceMap)); } - return workspace.write(bundle); + return Promise.all(writes); } })); }); diff --git a/lib/tasks/bundlers/generateStandaloneAppBundle.js b/lib/tasks/bundlers/generateStandaloneAppBundle.js index e843f0395..7621c447c 100644 --- a/lib/tasks/bundlers/generateStandaloneAppBundle.js +++ b/lib/tasks/bundlers/generateStandaloneAppBundle.js @@ -1,6 +1,7 @@ const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateStandaloneAppBundle"); const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; const moduleBundler = require("../../processors/bundlers/moduleBundler"); +const ModuleName = require("../../lbt/utils/ModuleName"); function getBundleDefinition(config) { const bundleDefinition = { @@ -88,8 +89,7 @@ module.exports = async function({workspace, dependencies, taskUtil, options: {pr return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsDebugVariant); }); } - const results = await combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library}"); - const resources = Array.prototype.concat.apply([], results); + const resources = await combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}"); const isEvo = resources.find((resource) => { return resource.getPath() === "/resources/ui5loader.js"; @@ -101,6 +101,35 @@ module.exports = async function({workspace, dependencies, taskUtil, options: {pr filters = ["jquery.sap.global.js"]; } + const unoptimizedModuleNameMapping = {}; + let unoptimizedResources = resources; + if (taskUtil) { + unoptimizedResources = await new ReaderCollectionPrioritized({ + name: `generateStandaloneAppBundle - prioritize workspace over dependencies: ${projectName}`, + readers: [workspace, dependencies] + }).filter(function(resource) { + // Remove any non-debug variants + return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant); + }).byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}"); + + // For "unoptimized" bundles, the non-debug files have already been filtered out above. + // Now we need to create a mapping from the debug-variant resource path to the respective module name, + // which is basically the non-debug resource path, minus the "/resources/"" prefix. + // This mapping overwrites internal logic of the LocatorResourcePool which would otherwise determine + // the module name from the resource path, which would contain "-dbg" in this case. That would be + // incorrect since debug-variants should still keep the original module name. + for (let i = unoptimizedResources.length - 1; i >= 0; i--) { + const resourcePath = unoptimizedResources[i].getPath(); + if (taskUtil.getTag(resourcePath, taskUtil.STANDARD_TAGS.IsDebugVariant)) { + const nonDbgPath = ModuleName.getNonDebugName(resourcePath); + if (!nonDbgPath) { + throw new Error(`Failed to resolve non-debug name for ${resourcePath}`); + } + unoptimizedModuleNameMapping[resourcePath] = nonDbgPath.slice("/resources/".length); + } + } + } + await Promise.all([ moduleBundler({ resources, @@ -114,7 +143,7 @@ module.exports = async function({workspace, dependencies, taskUtil, options: {pr } }), moduleBundler({ - resources, + resources: unoptimizedResources, options: { bundleDefinition: getBundleDefinition({ name: "sap-ui-custom-dbg.js", @@ -123,16 +152,26 @@ module.exports = async function({workspace, dependencies, taskUtil, options: {pr }), bundleOptions: { optimize: false - } + }, + moduleNameMapping: unoptimizedModuleNameMapping } }) ]).then((results) => { const bundles = Array.prototype.concat.apply([], results); - return Promise.all(bundles.map((resource) => { + return Promise.all(bundles.map(({bundle, sourceMap}) => { if (taskUtil) { - taskUtil.setTag(resource, taskUtil.STANDARD_TAGS.IsBundle); + taskUtil.setTag(bundle, taskUtil.STANDARD_TAGS.IsBundle); + if (sourceMap) { + // Clear tag that might have been set by the minify task, in cases where + // the bundle name is identical to a source file + taskUtil.clearTag(sourceMap, taskUtil.STANDARD_TAGS.OmitFromBuildResult); + } + } + const writes = [workspace.write(bundle)]; + if (sourceMap) { + writes.push(workspace.write(sourceMap)); } - return workspace.write(resource); + return Promise.all(writes); })); }); }; diff --git a/lib/tasks/generateResourcesJson.js b/lib/tasks/generateResourcesJson.js index 9c99f6161..38992175a 100644 --- a/lib/tasks/generateResourcesJson.js +++ b/lib/tasks/generateResourcesJson.js @@ -105,7 +105,7 @@ function getCreatorOptions(projectName) { module.exports = async function({workspace, dependencies, taskUtil, options: {projectName}}) { let resources = await workspace.byGlob(["/resources/**/*"].concat(DEFAULT_EXCLUDES)); let dependencyResources = - await dependencies.byGlob("/resources/**/*.{js,json,xml,html,properties,library}"); + await dependencies.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}"); if (taskUtil) { // Filter out resources that will be omitted from the build results diff --git a/lib/tasks/minify.js b/lib/tasks/minify.js index 007f6f0fc..3fe5c6ddf 100644 --- a/lib/tasks/minify.js +++ b/lib/tasks/minify.js @@ -10,17 +10,25 @@ const minifier = require("../processors/minifier"); * @param {module:@ui5/builder.tasks.TaskUtil|object} [parameters.taskUtil] TaskUtil * @param {object} parameters.options Options * @param {string} parameters.options.pattern Pattern to locate the files to be processed + * @param {boolean} [parameters.options.omitSourceMapResources=true] Whether source map resources shall + * be tagged as "OmitFromBuildResult" and no sourceMappingURL shall be added to the minified resource * @returns {Promise} Promise resolving with undefined once data has been written */ -module.exports = async function({workspace, taskUtil, options: {pattern}}) { +module.exports = async function({workspace, taskUtil, options: {pattern, omitSourceMapResources = true}}) { const resources = await workspace.byGlob(pattern); - const processedResources = await minifier({resources}); + const processedResources = await minifier({ + resources, + addSourceMappingUrl: !omitSourceMapResources + }); return Promise.all(processedResources.map(async ({resource, dbgResource, sourceMapResource}) => { if (taskUtil) { taskUtil.setTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant); taskUtil.setTag(dbgResource, taskUtil.STANDARD_TAGS.IsDebugVariant); - taskUtil.setTag(sourceMapResource, taskUtil.STANDARD_TAGS.OmitFromBuildResult); + taskUtil.setTag(sourceMapResource, taskUtil.STANDARD_TAGS.HasDebugVariant); + if (omitSourceMapResources) { + taskUtil.setTag(sourceMapResource, taskUtil.STANDARD_TAGS.OmitFromBuildResult); + } } return Promise.all([ workspace.write(resource), diff --git a/package-lock.json b/package-lock.json index 352abd1d1..228c8ab5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "replacestream": "^4.0.3", "rimraf": "^3.0.2", "semver": "^7.3.5", + "sourcemap-codec": "^1.4.8", "terser": "^5.10.0", "xml2js": "^0.4.23", "yazl": "^2.5.1" @@ -6532,8 +6533,7 @@ "node_modules/sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" }, "node_modules/spawn-wrap": { "version": "2.0.0", @@ -12581,8 +12581,7 @@ "sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" }, "spawn-wrap": { "version": "2.0.0", diff --git a/package.json b/package.json index da2ceb6ea..a726f1d0c 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,7 @@ "replacestream": "^4.0.3", "rimraf": "^3.0.2", "semver": "^7.3.5", + "sourcemap-codec": "^1.4.8", "terser": "^5.10.0", "xml2js": "^0.4.23", "yazl": "^2.5.1" diff --git a/test/expected/build/application.a/dest-deps-excl/test.js b/test/expected/build/application.a/dest-deps-excl/test.js index 24b3706c6..fd8278c6e 100644 --- a/test/expected/build/application.a/dest-deps-excl/test.js +++ b/test/expected/build/application.a/dest-deps-excl/test.js @@ -1,2 +1 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js index 75aba1e23..c23f5f207 100644 --- a/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js +++ b/test/expected/build/application.a/dest-deps-incl/resources/library/d/some.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js index 9b62890d8..e69de29bb 100644 --- a/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js +++ b/test/expected/build/application.a/dest-deps-incl/resources/ui5loader.js @@ -1,2 +0,0 @@ - -//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-incl/test.js b/test/expected/build/application.a/dest-deps-incl/test.js index 24b3706c6..fd8278c6e 100644 --- a/test/expected/build/application.a/dest-deps-incl/test.js +++ b/test/expected/build/application.a/dest-deps-incl/test.js @@ -1,2 +1 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/some.js b/test/expected/build/application.a/dest-deps/resources/library/d/some.js index 75aba1e23..c23f5f207 100644 --- a/test/expected/build/application.a/dest-deps/resources/library/d/some.js +++ b/test/expected/build/application.a/dest-deps/resources/library/d/some.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/ui5loader.js b/test/expected/build/application.a/dest-deps/resources/ui5loader.js index 9b62890d8..e69de29bb 100644 --- a/test/expected/build/application.a/dest-deps/resources/ui5loader.js +++ b/test/expected/build/application.a/dest-deps/resources/ui5loader.js @@ -1,2 +0,0 @@ - -//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/test.js b/test/expected/build/application.a/dest-deps/test.js index 24b3706c6..fd8278c6e 100644 --- a/test/expected/build/application.a/dest-deps/test.js +++ b/test/expected/build/application.a/dest-deps/test.js @@ -1,2 +1 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/some.js b/test/expected/build/application.a/dest-depself/resources/library/d/some.js index 75aba1e23..c23f5f207 100644 --- a/test/expected/build/application.a/dest-depself/resources/library/d/some.js +++ b/test/expected/build/application.a/dest-depself/resources/library/d/some.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js index 456319972..54dbb5e7d 100644 --- a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js @@ -1 +1,2 @@ //@ui5-bundle sap-ui-custom-dbg.js +//# sourceMappingURL=sap-ui-custom-dbg.js.map diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js.map b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js.map new file mode 100644 index 000000000..7c185dcc4 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-custom-dbg.js","sections":[]} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js index b03a55c6e..0a39f3213 100644 --- a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js @@ -1,12 +1,13 @@ //@ui5-bundle sap-ui-custom.js sap.ui.require.preload({ - "application/a/test.js":function(){sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map + "application/a/test.js":function(){ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); }, - "library/d/some.js":function(){/*! + "library/d/some.js":function(){ +/*! * Some fancy copyright */ (function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map } }); +//# sourceMappingURL=sap-ui-custom.js.map diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js.map b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js.map new file mode 100644 index 000000000..a8c0b442f --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-custom.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["sap-ui-custom.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js","sourceRoot":"application/a"}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":"AAAA;;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js","sourceRoot":"library/d"}}]} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/ui5loader.js b/test/expected/build/application.a/dest-depself/resources/ui5loader.js index 9b62890d8..e69de29bb 100644 --- a/test/expected/build/application.a/dest-depself/resources/ui5loader.js +++ b/test/expected/build/application.a/dest-depself/resources/ui5loader.js @@ -1,2 +0,0 @@ - -//# sourceMappingURL=ui5loader.js.map \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/test.js b/test/expected/build/application.a/dest-depself/test.js index 24b3706c6..fd8278c6e 100644 --- a/test/expected/build/application.a/dest-depself/test.js +++ b/test/expected/build/application.a/dest-depself/test.js @@ -1,2 +1 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js b/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js index 456319972..54dbb5e7d 100644 --- a/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js @@ -1 +1,2 @@ //@ui5-bundle sap-ui-custom-dbg.js +//# sourceMappingURL=sap-ui-custom-dbg.js.map diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js.map b/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js.map new file mode 100644 index 000000000..7c185dcc4 --- /dev/null +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-custom-dbg.js","sections":[]} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js index 5016d451e..9605939bb 100644 --- a/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js @@ -1,9 +1,10 @@ //@ui5-bundle sap-ui-custom.js sap.ui.require.preload({ - "application/a/test.js":function(){sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map + "application/a/test.js":function(){ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); }, - "library/d/some.js":function(){/*! + "library/d/some.js":function(){ +/*! * ${copyright} */ (function() { @@ -12,3 +13,4 @@ sap.ui.require.preload({ })(); } }); +//# sourceMappingURL=sap-ui-custom.js.map diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js.map b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js.map new file mode 100644 index 000000000..587957a0b --- /dev/null +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-custom.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["sap-ui-custom.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["test-dbg.js"],"names":["sap","ui","define","someObject","test","paramA","variableA","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CACV,kBACD,SAASC,GACX,SAASC,EAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js","sourceRoot":"application/a"}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["some.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"library/d"}}]} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-self/test.js b/test/expected/build/application.a/dest-self/test.js index 24b3706c6..fd8278c6e 100644 --- a/test/expected/build/application.a/dest-self/test.js +++ b/test/expected/build/application.a/dest-self/test.js @@ -1,2 +1 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest/test.js b/test/expected/build/application.a/dest/test.js index 24b3706c6..fd8278c6e 100644 --- a/test/expected/build/application.a/dest/test.js +++ b/test/expected/build/application.a/dest/test.js @@ -1,2 +1 @@ -sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.b/dest/embedded/i18n_fr.properties b/test/expected/build/application.b/dest/embedded/i18n_fr.properties new file mode 100644 index 000000000..85e162740 --- /dev/null +++ b/test/expected/build/application.b/dest/embedded/i18n_fr.properties @@ -0,0 +1 @@ +title=embedded-i18n_fr-wrong \ No newline at end of file diff --git a/test/expected/build/application.b/dest/i18n.properties b/test/expected/build/application.b/dest/i18n.properties new file mode 100644 index 000000000..e8dc9e0da --- /dev/null +++ b/test/expected/build/application.b/dest/i18n.properties @@ -0,0 +1,2 @@ +title=app-i18n-wrong +fame=Stra\u00dfe \ No newline at end of file diff --git a/test/expected/build/application.b/dest/i18n/l10n.properties b/test/expected/build/application.b/dest/i18n/l10n.properties new file mode 100644 index 000000000..e8dc9e0da --- /dev/null +++ b/test/expected/build/application.b/dest/i18n/l10n.properties @@ -0,0 +1,2 @@ +title=app-i18n-wrong +fame=Stra\u00dfe \ No newline at end of file diff --git a/test/expected/build/application.b/dest/manifest-bundle.zip b/test/expected/build/application.b/dest/manifest-bundle.zip new file mode 100644 index 0000000000000000000000000000000000000000..1e5d351a8c9f556ee434bdae28a3eb81205dfcbc GIT binary patch literal 1129 zcmWIWW@Zs#VBp|j$Sm{-u?x$+(aONUz|Y9QAO@sUbCXh2Qc_d&a})D2(^88|^s>raY>Gh0ehr$8p2H@jEq@T z=FCj$(1{3&oWLc-CN*{P%sCNEmwHrsRb<%Ar4kh*c)RAhRk?W;yo^$r98^3xD7dS! zYmwraDOW_6Mx?Z-OncH08x+f%cI}$enUzmhJ!N7*b?BMUzn4UT4ipArSs;doaHgR} zo<4}sD=5k@NG&SKOfA+vsdLhEtM6G~FJDhj--~BWwwz!_GjHwTxfT*Yb3n1BfYrSC zlvMmicKds>qM7={@*AfL&@?3=76)Rup9A&inH0=!YpKuR!rf*!vi e=rM*cBoWyV6i>0TfmE>p;e4R8w*b{KFaQ96t5LTA literal 0 HcmV?d00001 diff --git a/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js b/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js index be330319f..431dde210 100644 --- a/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js +++ b/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js @@ -7,3 +7,4 @@ sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); +//# sourceMappingURL=sap-ui-custom-dbg.js.map diff --git a/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js.map b/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js.map new file mode 100644 index 000000000..0a374bce4 --- /dev/null +++ b/test/expected/build/application.b/standalone/resources/sap-ui-custom-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-custom-dbg.js","sections":[{"offset":{"line":2,"column":0},"map":{"version":3,"sources":["ui5loader-autoconfig.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["sap-ui-custom-dbg.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.requireSync(\"sap/ui/core/Core\");\n"],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["sap-ui-custom-dbg.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["// as this module contains the Core, we ensure that the Core has been booted\nsap.ui.getCore().boot && sap.ui.getCore().boot();"],"sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.b/standalone/resources/sap-ui-custom.js b/test/expected/build/application.b/standalone/resources/sap-ui-custom.js index b68d6920b..df8d2af8b 100644 --- a/test/expected/build/application.b/standalone/resources/sap-ui-custom.js +++ b/test/expected/build/application.b/standalone/resources/sap-ui-custom.js @@ -14,7 +14,8 @@ sap.ui.require.preload({ "id1/i18n/i18n_de.properties":'title=app-i18n_de\nfame=Stra\\u00dfe', "id1/i18n/l10n.properties":'title=app-i18n-wrong\nfame=Stra\\u00dfe', "id1/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"id1","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "sap/ui/core/Core.js":function(){(function () { + "sap/ui/core/Core.js":function(){ +(function () { var core = true; console.log(core); })() @@ -23,3 +24,4 @@ sap.ui.require.preload({ sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); +//# sourceMappingURL=sap-ui-custom.js.map diff --git a/test/expected/build/application.b/standalone/resources/sap-ui-custom.js.map b/test/expected/build/application.b/standalone/resources/sap-ui-custom.js.map new file mode 100644 index 000000000..d98966387 --- /dev/null +++ b/test/expected/build/application.b/standalone/resources/sap-ui-custom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-custom.js","sections":[{"offset":{"line":2,"column":0},"map":{"version":3,"sources":["ui5loader-autoconfig.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["sap-ui-custom.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":17,"column":0},"map":{"version":3,"sources":["Core.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":"sap/ui/core"}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["sap-ui-custom.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.requireSync(\"sap/ui/core/Core\");\n"],"sourceRoot":""}},{"offset":{"line":24,"column":0},"map":{"version":3,"sources":["sap-ui-custom.js?bundle-code-2"],"mappings":"AAAA;AACA","sourcesContent":["// as this module contains the Core, we ensure that the Core has been booted\nsap.ui.getCore().boot && sap.ui.getCore().boot();"],"sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/Component-preload.js b/test/expected/build/application.g/cachebuster/Component-preload.js index e42a2092a..b1f089a2a 100644 --- a/test/expected/build/application.g/cachebuster/Component-preload.js +++ b/test/expected/build/application.g/cachebuster/Component-preload.js @@ -2,16 +2,17 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}', - "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentA/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentB/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/cachebuster/Component-preload.js.map b/test/expected/build/application.g/cachebuster/Component-preload.js.map new file mode 100644 index 000000000..407e4420d --- /dev/null +++ b/test/expected/build/application.g/cachebuster/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentA"}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentB"}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/Component.js b/test/expected/build/application.g/cachebuster/Component.js index 6ad3cfb41..6fdb761a9 100644 --- a/test/expected/build/application.g/cachebuster/Component.js +++ b/test/expected/build/application.g/cachebuster/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json b/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json index a8cc8479d..b7fb26273 100644 --- a/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json +++ b/test/expected/build/application.g/cachebuster/sap-ui-cachebuster-info.json @@ -1,15 +1,16 @@ { - "subcomponentB/Component-dbg.js": 1542320456755, - "subcomponentA/manifest.json": 1542320456755, - "manifest.json": 1603970570100, - "subcomponentA/Component.js": 1542320456755, - "subcomponentB/manifest.json": 1542320456755, - "Component.js": 1542320456754, - "Component-dbg.js": 1542320456754, - "Component.js.map": 1638483275870, - "subcomponentA/Component-dbg.js": 1542320456755, - "subcomponentA/Component.js.map": 1638483275870, - "subcomponentB/Component.js": 1542320456755, - "subcomponentB/Component.js.map": 1638483275871, - "Component-preload.js": 1638483275995 + "subcomponentB/manifest.json": 1563262681148, + "subcomponentA/manifest.json": 1563262681148, + "manifest.json": 1563262681147, + "subcomponentB/Component.js": 1563262681148, + "subcomponentA/Component.js": 1563262681148, + "Component.js": 1563262681147, + "subcomponentA/Component-dbg.js": 1563262681148, + "subcomponentA/Component.js.map": 1645537451553, + "subcomponentB/Component-dbg.js": 1563262681148, + "subcomponentB/Component.js.map": 1645537451553, + "Component-dbg.js": 1563262681147, + "Component.js.map": 1645537451553, + "Component-preload.js": 1645537451980, + "Component-preload.js.map": 1645537451980 } \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/subcomponentA/Component.js b/test/expected/build/application.g/cachebuster/subcomponentA/Component.js index b53909394..0d3fd6ccc 100644 --- a/test/expected/build/application.g/cachebuster/subcomponentA/Component.js +++ b/test/expected/build/application.g/cachebuster/subcomponentA/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster/subcomponentB/Component.js b/test/expected/build/application.g/cachebuster/subcomponentB/Component.js index c5cc2084d..c8af2ace9 100644 --- a/test/expected/build/application.g/cachebuster/subcomponentB/Component.js +++ b/test/expected/build/application.g/cachebuster/subcomponentB/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/Component-preload.js b/test/expected/build/application.g/cachebuster_hash/Component-preload.js index e42a2092a..b1f089a2a 100644 --- a/test/expected/build/application.g/cachebuster_hash/Component-preload.js +++ b/test/expected/build/application.g/cachebuster_hash/Component-preload.js @@ -2,16 +2,17 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}', - "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentA/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentB/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map b/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map new file mode 100644 index 000000000..407e4420d --- /dev/null +++ b/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentA"}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentB"}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/Component.js b/test/expected/build/application.g/cachebuster_hash/Component.js index 6ad3cfb41..6fdb761a9 100644 --- a/test/expected/build/application.g/cachebuster_hash/Component.js +++ b/test/expected/build/application.g/cachebuster_hash/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json b/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json index 68f5436bc..5d91cc749 100644 --- a/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json +++ b/test/expected/build/application.g/cachebuster_hash/sap-ui-cachebuster-info.json @@ -1,15 +1,16 @@ { - "Component.js": "174e92417f0fa7889c2bdb8a243c4d748d66a4da", - "subcomponentB/manifest.json": "3a08d0555e3e49fe683e01205090eed3182b4a9f", + "Component-dbg.js": "874c35543ae850262d1552b6c2d00cecaae205a7", + "subcomponentA/manifest.json": "7dfcdf568dcfb47c74d309e2f00193688b112fb7", "manifest.json": "a867583cff8c3a5135bfbdd97dcb7a9cad4948bd", - "subcomponentB/Component.js": "d2a467cc8d05c693b22dbef82c2bff4610611d81", + "subcomponentB/manifest.json": "3a08d0555e3e49fe683e01205090eed3182b4a9f", "subcomponentA/Component.js": "37e2d3c99ddf728313ceaddd087c6d547fcbdf8f", - "subcomponentA/manifest.json": "7dfcdf568dcfb47c74d309e2f00193688b112fb7", - "subcomponentB/Component-dbg.js": "c03da2c5ff162c1d9d5e5c4a3edc2cebcda6b0a1", - "subcomponentB/Component.js.map": "76cd9820f761dd43fe4b2a6f5397d09625603e0d", + "Component.js": "174e92417f0fa7889c2bdb8a243c4d748d66a4da", "subcomponentA/Component-dbg.js": "fef3a5814776e5575302f814e96ae31a13df12b7", "subcomponentA/Component.js.map": "76cd9820f761dd43fe4b2a6f5397d09625603e0d", - "Component-dbg.js": "874c35543ae850262d1552b6c2d00cecaae205a7", + "subcomponentB/Component-dbg.js": "c03da2c5ff162c1d9d5e5c4a3edc2cebcda6b0a1", + "subcomponentB/Component.js.map": "76cd9820f761dd43fe4b2a6f5397d09625603e0d", + "subcomponentB/Component.js": "d2a467cc8d05c693b22dbef82c2bff4610611d81", "Component.js.map": "35e88e40f4933fe235a359361d7bd3459e6f5235", - "Component-preload.js": "d55d19cde640e716b1e03fe44d21436d5158db09" + "Component-preload.js": "5a4592408148af17538a1ee2c70c310931d2575c", + "Component-preload.js.map": "3b5d5de04ca05341ed50444277945dac240505f6" } \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js index b53909394..0d3fd6ccc 100644 --- a/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentA/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js index c5cc2084d..c8af2ace9 100644 --- a/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js +++ b/test/expected/build/application.g/cachebuster_hash/subcomponentB/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest/Component-preload.js b/test/expected/build/application.g/dest/Component-preload.js index 3754c4605..a186e8cc7 100644 --- a/test/expected/build/application.g/dest/Component-preload.js +++ b/test/expected/build/application.g/dest/Component-preload.js @@ -2,8 +2,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest/Component-preload.js.map b/test/expected/build/application.g/dest/Component-preload.js.map new file mode 100644 index 000000000..a7a60e6f3 --- /dev/null +++ b/test/expected/build/application.g/dest/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/Component.js b/test/expected/build/application.g/dest/Component.js index 6ad3cfb41..6fdb761a9 100644 --- a/test/expected/build/application.g/dest/Component.js +++ b/test/expected/build/application.g/dest/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js index 47f678316..63ae65bd3 100644 --- a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js +++ b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js @@ -2,8 +2,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentA/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map new file mode 100644 index 000000000..86937b5b0 --- /dev/null +++ b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentA/Component.js b/test/expected/build/application.g/dest/subcomponentA/Component.js index b53909394..0d3fd6ccc 100644 --- a/test/expected/build/application.g/dest/subcomponentA/Component.js +++ b/test/expected/build/application.g/dest/subcomponentA/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js index f6815fb06..ec2301f6d 100644 --- a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js +++ b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js @@ -2,8 +2,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentB/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map new file mode 100644 index 000000000..86937b5b0 --- /dev/null +++ b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentB/Component.js b/test/expected/build/application.g/dest/subcomponentB/Component.js index c5cc2084d..c8af2ace9 100644 --- a/test/expected/build/application.g/dest/subcomponentB/Component.js +++ b/test/expected/build/application.g/dest/subcomponentB/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/Component-preload.js b/test/expected/build/application.g/dest2/Component-preload.js index 3754c4605..a186e8cc7 100644 --- a/test/expected/build/application.g/dest2/Component-preload.js +++ b/test/expected/build/application.g/dest2/Component-preload.js @@ -2,8 +2,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest2/Component-preload.js.map b/test/expected/build/application.g/dest2/Component-preload.js.map new file mode 100644 index 000000000..a7a60e6f3 --- /dev/null +++ b/test/expected/build/application.g/dest2/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/Component.js b/test/expected/build/application.g/dest2/Component.js index 6ad3cfb41..6fdb761a9 100644 --- a/test/expected/build/application.g/dest2/Component.js +++ b/test/expected/build/application.g/dest2/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js index 47f678316..63ae65bd3 100644 --- a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js +++ b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js @@ -2,8 +2,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentA/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map new file mode 100644 index 000000000..86937b5b0 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component.js b/test/expected/build/application.g/dest2/subcomponentA/Component.js index b53909394..0d3fd6ccc 100644 --- a/test/expected/build/application.g/dest2/subcomponentA/Component.js +++ b/test/expected/build/application.g/dest2/subcomponentA/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js index f6815fb06..ec2301f6d 100644 --- a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js +++ b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js @@ -2,8 +2,9 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/g/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/g/subcomponentB/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map new file mode 100644 index 000000000..86937b5b0 --- /dev/null +++ b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component.js b/test/expected/build/application.g/dest2/subcomponentB/Component.js index c5cc2084d..c8af2ace9 100644 --- a/test/expected/build/application.g/dest2/subcomponentB/Component.js +++ b/test/expected/build/application.g/dest2/subcomponentB/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/Component.js b/test/expected/build/application.h/dest/Component.js index ccde11646..acf57e86e 100644 --- a/test/expected/build/application.h/dest/Component.js +++ b/test/expected/build/application.h/dest/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.h.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.h.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/customBundle.js b/test/expected/build/application.h/dest/sectionsA/customBundle.js index 4292cdd48..50d9eba4b 100644 --- a/test/expected/build/application.h/dest/sectionsA/customBundle.js +++ b/test/expected/build/application.h/dest/sectionsA/customBundle.js @@ -2,10 +2,11 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/h/sectionsA/section1.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); -//# sourceMappingURL=section1.js.map + "application/h/sectionsA/section1.js":function(){ +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); }, - "application/h/sectionsA/section3.js":function(){sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); -//# sourceMappingURL=section3.js.map + "application/h/sectionsA/section3.js":function(){ +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); } }}); +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/dest/sectionsA/customBundle.js.map b/test/expected/build/application.h/dest/sectionsA/customBundle.js.map new file mode 100644 index 000000000..d4d5782ad --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsA/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section1.js","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["section3-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section3.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section1.js b/test/expected/build/application.h/dest/sectionsA/section1.js index 740930367..1ec2e3184 100644 --- a/test/expected/build/application.h/dest/sectionsA/section1.js +++ b/test/expected/build/application.h/dest/sectionsA/section1.js @@ -1,2 +1 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); -//# sourceMappingURL=section1.js.map \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section2.js b/test/expected/build/application.h/dest/sectionsA/section2.js index 653acdb83..a446217a5 100644 --- a/test/expected/build/application.h/dest/sectionsA/section2.js +++ b/test/expected/build/application.h/dest/sectionsA/section2.js @@ -1,2 +1 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); -//# sourceMappingURL=section2.js.map \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/section3.js b/test/expected/build/application.h/dest/sectionsA/section3.js index 70c1434ed..8358bbe01 100644 --- a/test/expected/build/application.h/dest/sectionsA/section3.js +++ b/test/expected/build/application.h/dest/sectionsA/section3.js @@ -1,2 +1 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); -//# sourceMappingURL=section3.js.map \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/customBundle.js b/test/expected/build/application.h/dest/sectionsB/customBundle.js index 2ee5ae456..ab1c24af1 100644 --- a/test/expected/build/application.h/dest/sectionsB/customBundle.js +++ b/test/expected/build/application.h/dest/sectionsB/customBundle.js @@ -2,16 +2,20 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/h/sectionsB/section1.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsB/section1.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 1 included"); }); }, - "application/h/sectionsB/section2.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsB/section2.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 2 included"); }); }, - "application/h/sectionsB/section3.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsB/section3.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 3 included"); }); } }}); +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/dest/sectionsB/customBundle.js.map b/test/expected/build/application.h/dest/sectionsB/customBundle.js.map new file mode 100644 index 000000000..a4a89d247 --- /dev/null +++ b/test/expected/build/application.h/dest/sectionsB/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["section2-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["section3-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section1.js b/test/expected/build/application.h/dest/sectionsB/section1.js index 740930367..1ec2e3184 100644 --- a/test/expected/build/application.h/dest/sectionsB/section1.js +++ b/test/expected/build/application.h/dest/sectionsB/section1.js @@ -1,2 +1 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); -//# sourceMappingURL=section1.js.map \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section2.js b/test/expected/build/application.h/dest/sectionsB/section2.js index 653acdb83..a446217a5 100644 --- a/test/expected/build/application.h/dest/sectionsB/section2.js +++ b/test/expected/build/application.h/dest/sectionsB/section2.js @@ -1,2 +1 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); -//# sourceMappingURL=section2.js.map \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 2 included")}); \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/section3.js b/test/expected/build/application.h/dest/sectionsB/section3.js index 70c1434ed..8358bbe01 100644 --- a/test/expected/build/application.h/dest/sectionsB/section3.js +++ b/test/expected/build/application.h/dest/sectionsB/section3.js @@ -1,2 +1 @@ -sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); -//# sourceMappingURL=section3.js.map \ No newline at end of file +sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); \ No newline at end of file diff --git a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js index 3bd827332..3512dedd4 100644 --- a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js +++ b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js @@ -2,12 +2,15 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/h/sectionsA/section1.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsA/section1.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 1 included"); }); }, - "application/h/sectionsA/section3.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsA/section3.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 3 included"); }); } }}); +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map new file mode 100644 index 000000000..fb67f722e --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["section3.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js index 2ee5ae456..ab1c24af1 100644 --- a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js +++ b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js @@ -2,16 +2,20 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/h/sectionsB/section1.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsB/section1.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 1 included"); }); }, - "application/h/sectionsB/section2.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsB/section2.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 2 included"); }); }, - "application/h/sectionsB/section3.js":function(){sap.ui.define(["sap/m/Button"], function(Button) { + "application/h/sectionsB/section3.js":function(){ +sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 3 included"); }); } }}); +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map new file mode 100644 index 000000000..f42d1805c --- /dev/null +++ b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["section2.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["section3.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.i/dest/Component-preload.js b/test/expected/build/application.i/dest/Component-preload.js index 929f49213..a23378704 100644 --- a/test/expected/build/application.i/dest/Component-preload.js +++ b/test/expected/build/application.i/dest/Component-preload.js @@ -2,13 +2,14 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/i/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/i/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); }, "application/i/changes/changes-bundle.json":'[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.i.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.i.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.i.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.i.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}]', - "application/i/changes/coding/MyExtension.js":function(){sap.ui.define([],function(){return{}}); -//# sourceMappingURL=MyExtension.js.map + "application/i/changes/coding/MyExtension.js":function(){ +sap.ui.define([],function(){return{}}); }, "application/i/changes/fragments/MyFragment.fragment.xml":'', "application/i/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.i","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{}}}}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.i/dest/Component-preload.js.map b/test/expected/build/application.i/dest/Component-preload.js.map new file mode 100644 index 000000000..adda28edc --- /dev/null +++ b/test/expected/build/application.i/dest/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file diff --git a/test/expected/build/application.i/dest/Component.js b/test/expected/build/application.i/dest/Component.js index 5d50a2eff..f172a1f15 100644 --- a/test/expected/build/application.i/dest/Component.js +++ b/test/expected/build/application.i/dest/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.i/dest/changes/coding/MyExtension.js b/test/expected/build/application.i/dest/changes/coding/MyExtension.js index ce81ba310..b9e475d8e 100644 --- a/test/expected/build/application.i/dest/changes/coding/MyExtension.js +++ b/test/expected/build/application.i/dest/changes/coding/MyExtension.js @@ -1,2 +1 @@ -sap.ui.define([],function(){return{}}); -//# sourceMappingURL=MyExtension.js.map \ No newline at end of file +sap.ui.define([],function(){return{}}); \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/Component-preload.js b/test/expected/build/application.j/dest-resources-json/Component-preload.js index b00969cfa..62fee9e16 100644 --- a/test/expected/build/application.j/dest-resources-json/Component-preload.js +++ b/test/expected/build/application.j/dest-resources-json/Component-preload.js @@ -2,13 +2,14 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/j/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/j/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); }, - "application/j/changes/coding/MyExtension.js":function(){sap.ui.define([],function(){return{}}); -//# sourceMappingURL=MyExtension.js.map + "application/j/changes/coding/MyExtension.js":function(){ +sap.ui.define([],function(){return{}}); }, "application/j/changes/flexibility-bundle.json":'{"changes":[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}],"compVariants":[{"fileName":"id_111_compVariants","fileType":"variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"appDescriptorChange":false}],"variants":[{"fileName":"id_111_test","fileType":"ctrl_variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantDependentControlChanges":[{"fileName":"id_111_variantDependentControlChange","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"variantReference":"someting here"}],"variantManagementChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_management_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}]}', "application/j/changes/fragments/MyFragment.fragment.xml":'', "application/j/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.j","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.73.2","libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{"lazy":false}}}}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.j/dest-resources-json/Component-preload.js.map b/test/expected/build/application.j/dest-resources-json/Component-preload.js.map new file mode 100644 index 000000000..a7bfb3e24 --- /dev/null +++ b/test/expected/build/application.j/dest-resources-json/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/Component.js b/test/expected/build/application.j/dest-resources-json/Component.js index f64b0734d..984f96eaf 100644 --- a/test/expected/build/application.j/dest-resources-json/Component.js +++ b/test/expected/build/application.j/dest-resources-json/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js index ce81ba310..b9e475d8e 100644 --- a/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js +++ b/test/expected/build/application.j/dest-resources-json/changes/coding/MyExtension.js @@ -1,2 +1 @@ -sap.ui.define([],function(){return{}}); -//# sourceMappingURL=MyExtension.js.map \ No newline at end of file +sap.ui.define([],function(){return{}}); \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/resources.json b/test/expected/build/application.j/dest-resources-json/resources.json index 3c72c06fb..7612bf68d 100644 --- a/test/expected/build/application.j/dest-resources-json/resources.json +++ b/test/expected/build/application.j/dest-resources-json/resources.json @@ -17,7 +17,7 @@ { "name": "Component-preload.js", "module": "application/j/Component-preload.js", - "size": 3760, + "size": 3730, "merged": true, "required": [ "sap/m/library.js", @@ -34,10 +34,15 @@ "application/j/manifest.json" ] }, + { + "name": "Component-preload.js.map", + "size": 836, + "isDebug": true + }, { "name": "Component.js", "module": "application/j/Component.js", - "size": 179, + "size": 141, "required": [ "sap/m/library.js", "sap/ui/core/UIComponent.js", @@ -55,7 +60,7 @@ { "name": "changes/coding/MyExtension.js", "module": "application/j/changes/coding/MyExtension.js", - "size": 79 + "size": 39 }, { "name": "changes/flexibility-bundle.json", @@ -78,7 +83,7 @@ }, { "name": "resources.json", - "size": 1923 + "size": 2006 } ] } \ No newline at end of file diff --git a/test/expected/build/application.j/dest/Component-preload.js b/test/expected/build/application.j/dest/Component-preload.js index b00969cfa..62fee9e16 100644 --- a/test/expected/build/application.j/dest/Component-preload.js +++ b/test/expected/build/application.j/dest/Component-preload.js @@ -2,13 +2,14 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/j/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/j/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); }, - "application/j/changes/coding/MyExtension.js":function(){sap.ui.define([],function(){return{}}); -//# sourceMappingURL=MyExtension.js.map + "application/j/changes/coding/MyExtension.js":function(){ +sap.ui.define([],function(){return{}}); }, "application/j/changes/flexibility-bundle.json":'{"changes":[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}],"compVariants":[{"fileName":"id_111_compVariants","fileType":"variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"appDescriptorChange":false}],"variants":[{"fileName":"id_111_test","fileType":"ctrl_variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantDependentControlChanges":[{"fileName":"id_111_variantDependentControlChange","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"variantReference":"someting here"}],"variantManagementChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_management_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}]}', "application/j/changes/fragments/MyFragment.fragment.xml":'', "application/j/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.j","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.73.2","libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{"lazy":false}}}}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.j/dest/Component-preload.js.map b/test/expected/build/application.j/dest/Component-preload.js.map new file mode 100644 index 000000000..a7bfb3e24 --- /dev/null +++ b/test/expected/build/application.j/dest/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file diff --git a/test/expected/build/application.j/dest/Component.js b/test/expected/build/application.j/dest/Component.js index f64b0734d..984f96eaf 100644 --- a/test/expected/build/application.j/dest/Component.js +++ b/test/expected/build/application.j/dest/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/application.j/dest/changes/coding/MyExtension.js b/test/expected/build/application.j/dest/changes/coding/MyExtension.js index ce81ba310..b9e475d8e 100644 --- a/test/expected/build/application.j/dest/changes/coding/MyExtension.js +++ b/test/expected/build/application.j/dest/changes/coding/MyExtension.js @@ -1,2 +1 @@ -sap.ui.define([],function(){return{}}); -//# sourceMappingURL=MyExtension.js.map \ No newline at end of file +sap.ui.define([],function(){return{}}); \ No newline at end of file diff --git a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js index ed8251c37..07f1270d6 100644 --- a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js +++ b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js @@ -2,7 +2,8 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "application/k/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.k.Component', { metadata: { @@ -12,7 +13,8 @@ jQuery.sap.registerPreloadedModules({ }); }, "application/k/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k","type":"application","applicationVersion":{"version":"${version}"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"${copyright}"}', - "application/k/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "application/k/subcomponentA/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.k.subcomponentA.Component', { metadata: { @@ -22,7 +24,8 @@ jQuery.sap.registerPreloadedModules({ }); }, "application/k/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "application/k/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "application/k/subcomponentB/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.k.subcomponentB.Component', { metadata: { @@ -32,6 +35,8 @@ jQuery.sap.registerPreloadedModules({ }); }, "application/k/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "application/k/subcomponentB/thirdparty/lib.js":function(){console.log("subcomponentB/thirdparty/lib.js"); + "application/k/subcomponentB/thirdparty/lib.js":function(){ +console.log("subcomponentB/thirdparty/lib.js"); } }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map new file mode 100644 index 000000000..721564654 --- /dev/null +++ b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":16,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"subcomponentA"}},{"offset":{"line":27,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"subcomponentB"}},{"offset":{"line":38,"column":0},"map":{"version":3,"sources":["lib.js"],"mappings":"AAAA;AACA","sourceRoot":"subcomponentB/thirdparty"}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest/Component-preload.js b/test/expected/build/application.k/dest/Component-preload.js index 12b9506ec..9eefb8942 100644 --- a/test/expected/build/application.k/dest/Component-preload.js +++ b/test/expected/build/application.k/dest/Component-preload.js @@ -2,7 +2,8 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "application/k/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.k.Component', { metadata: { @@ -13,3 +14,4 @@ jQuery.sap.registerPreloadedModules({ }, "application/k/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k","type":"application","applicationVersion":{"version":"${version}"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"${copyright}"}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest/Component-preload.js.map b/test/expected/build/application.k/dest/Component-preload.js.map new file mode 100644 index 000000000..61c83ce28 --- /dev/null +++ b/test/expected/build/application.k/dest/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js index 2e73aff3b..cb50c4d55 100644 --- a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js +++ b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js @@ -2,7 +2,8 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/subcomponentA/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "application/k/subcomponentA/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.k.subcomponentA.Component', { metadata: { @@ -13,3 +14,4 @@ jQuery.sap.registerPreloadedModules({ }, "application/k/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map new file mode 100644 index 000000000..61c83ce28 --- /dev/null +++ b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js index 24bf462a5..e09fbb22e 100644 --- a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js +++ b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js @@ -2,7 +2,8 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "application/k/subcomponentB/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "application/k/subcomponentB/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.k.subcomponentB.Component', { metadata: { @@ -12,6 +13,8 @@ jQuery.sap.registerPreloadedModules({ }); }, "application/k/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}', - "application/k/subcomponentB/thirdparty/lib.js":function(){console.log("subcomponentB/thirdparty/lib.js"); + "application/k/subcomponentB/thirdparty/lib.js":function(){ +console.log("subcomponentB/thirdparty/lib.js"); } }}); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map new file mode 100644 index 000000000..555d13778 --- /dev/null +++ b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":16,"column":0},"map":{"version":3,"sources":["lib.js"],"mappings":"AAAA;AACA","sourceRoot":"thirdparty"}}]} \ No newline at end of file diff --git a/test/expected/build/application.l/dest/subdir/index.js b/test/expected/build/application.l/dest/subdir/index.js index 9661d7207..894e5374f 100644 --- a/test/expected/build/application.l/dest/subdir/index.js +++ b/test/expected/build/application.l/dest/subdir/index.js @@ -1,2 +1 @@ -function hello(l){console.log("hello "+l)}hello("world"); -//# sourceMappingURL=index.js.map \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file diff --git a/test/expected/build/application.l/dest/subdir/thirdparty/File1.js b/test/expected/build/application.l/dest/subdir/thirdparty/File1.js index 7b3311e4e..894e5374f 100644 --- a/test/expected/build/application.l/dest/subdir/thirdparty/File1.js +++ b/test/expected/build/application.l/dest/subdir/thirdparty/File1.js @@ -1,2 +1 @@ -function hello(l){console.log("hello "+l)}hello("world"); -//# sourceMappingURL=File1.js.map \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file diff --git a/test/expected/build/application.l/dest/test.js b/test/expected/build/application.l/dest/test.js index 5a6672e9f..49687cdc2 100644 --- a/test/expected/build/application.l/dest/test.js +++ b/test/expected/build/application.l/dest/test.js @@ -1,2 +1 @@ -sap.ui.define([],function(){function n(n){var o=n;console.log(o)}n()}); -//# sourceMappingURL=test.js.map \ No newline at end of file +sap.ui.define([],function(){function n(n){var o=n;console.log(o)}n()}); \ No newline at end of file diff --git "a/test/expected/build/application.\303\270/dest/Component-preload.js" "b/test/expected/build/application.\303\270/dest/Component-preload.js" index 7b95d4e8a..eba461cf0 100644 --- "a/test/expected/build/application.\303\270/dest/Component-preload.js" +++ "b/test/expected/build/application.\303\270/dest/Component-preload.js" @@ -1,7 +1,8 @@ //@ui5-bundle application/ø/Component-preload.js sap.ui.require.preload({ - "application/ø/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map + "application/ø/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); }, "application/ø/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.ø","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.73.2","libs":{"sap.ui.core":{}}}}}' }); +//# sourceMappingURL=Component-preload.js.map diff --git "a/test/expected/build/application.\303\270/dest/Component-preload.js.map" "b/test/expected/build/application.\303\270/dest/Component-preload.js.map" new file mode 100644 index 000000000..cf93d8189 --- /dev/null +++ "b/test/expected/build/application.\303\270/dest/Component-preload.js.map" @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git "a/test/expected/build/application.\303\270/dest/Component.js" "b/test/expected/build/application.\303\270/dest/Component.js" index 8c43e4752..cc3bdb695 100644 --- "a/test/expected/build/application.\303\270/dest/Component.js" +++ "b/test/expected/build/application.\303\270/dest/Component.js" @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.ø.Component",{metadata:{manifest:"json"}})}); \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core-dbg.js b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core-dbg.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js b/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js deleted file mode 100644 index a72d46525..000000000 --- a/test/expected/build/library.coreBuildtime/dest/resources/sap-ui-core.js +++ /dev/null @@ -1,2 +0,0 @@ - -//# sourceMappingURL=sap-ui-core.js.map \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js deleted file mode 100644 index 8a2077bdb..000000000 --- a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global-dbg.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Some fancy copyright - */ -// replacement of $\{buildtime\} is only made in sap/ui/Global.js and Global-dbg.js -console.log('20220620-1630'); diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js deleted file mode 100644 index e0fe65e6f..000000000 --- a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/Global.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Some fancy copyright - */ -console.log("20220620-1630"); -//# sourceMappingURL=Global.js.map \ No newline at end of file diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library deleted file mode 100644 index f975d6a4e..000000000 --- a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/.library +++ /dev/null @@ -1,20 +0,0 @@ - - - - sap.ui.core - SAP SE - Some fancy copyright - 1.0.0 - - Core - - - - - - - - - - diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js deleted file mode 100644 index 124b349b7..000000000 --- a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core-dbg.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Some fancy copyright - */ -// replacement of $\{buildtime\} is only made in sap/ui/Global.js and Global-dbg.js -console.log('${buildtime}'); diff --git a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js b/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js deleted file mode 100644 index e625a5c05..000000000 --- a/test/expected/build/library.coreBuildtime/dest/resources/sap/ui/core/Core.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Some fancy copyright - */ -console.log("${buildtime}"); -//# sourceMappingURL=Core.js.map \ No newline at end of file diff --git a/test/expected/build/library.d/dest/resources/library/d/some.js b/test/expected/build/library.d/dest/resources/library/d/some.js index 75aba1e23..c23f5f207 100644 --- a/test/expected/build/library.d/dest/resources/library/d/some.js +++ b/test/expected/build/library.d/dest/resources/library/d/some.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/library.d/preload/resources/library/d/library-preload.js b/test/expected/build/library.d/preload/resources/library/d/library-preload.js index 68c443e80..12b0a1cb5 100644 --- a/test/expected/build/library.d/preload/resources/library/d/library-preload.js +++ b/test/expected/build/library.d/preload/resources/library/d/library-preload.js @@ -2,7 +2,8 @@ jQuery.sap.registerPreloadedModules({ "version":"2.0", "modules":{ - "library/d/some.js":function(){/*! + "library/d/some.js":function(){ +/*! * ${copyright} */ (function() { @@ -11,3 +12,4 @@ jQuery.sap.registerPreloadedModules({ })(); } }}); +//# sourceMappingURL=library-preload.js.map diff --git a/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map b/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map new file mode 100644 index 000000000..75adb2fe2 --- /dev/null +++ b/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["some.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.e/dest/resources/library/e/library.js b/test/expected/build/library.e/dest/resources/library/e/library.js index 648540278..39e3277ce 100644 --- a/test/expected/build/library.e/dest/resources/library/e/library.js +++ b/test/expected/build/library.e/dest/resources/library/e/library.js @@ -3,5 +3,4 @@ * (c) Copyright 2009-xxx SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ -console.log("HelloWorld"); -//# sourceMappingURL=library.js.map \ No newline at end of file +console.log("HelloWorld"); \ No newline at end of file diff --git a/test/expected/build/library.e/dest/resources/library/e/some.js b/test/expected/build/library.e/dest/resources/library/e/some.js index 36245f900..39e3277ce 100644 --- a/test/expected/build/library.e/dest/resources/library/e/some.js +++ b/test/expected/build/library.e/dest/resources/library/e/some.js @@ -3,5 +3,4 @@ * (c) Copyright 2009-xxx SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ -console.log("HelloWorld"); -//# sourceMappingURL=some.js.map \ No newline at end of file +console.log("HelloWorld"); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js index 58530f541..416739324 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js @@ -1,12 +1,13 @@ //@ui5-bundle library/h/components/Component-preload.js sap.ui.require.preload({ - "library/h/components/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); }, - "library/h/components/TodoComponent.js":function(){/*! + "library/h/components/TodoComponent.js":function(){ +/*! * Some fancy copyright */ console.log(" File "); -//# sourceMappingURL=TodoComponent.js.map } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js.map new file mode 100644 index 000000000..41305e36f --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["TodoComponent-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"TodoComponent.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js index f58e632b3..bcf866e67 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/TodoComponent.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" File "); -//# sourceMappingURL=TodoComponent.js.map \ No newline at end of file +console.log(" File "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json index 628c4b6fa..4df48478f 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/resources.json @@ -13,7 +13,7 @@ { "name": "Component-preload.js", "module": "library/h/components/Component-preload.js", - "size": 441, + "size": 409, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -23,10 +23,15 @@ "library/h/components/TodoComponent.js" ] }, + { + "name": "Component-preload.js.map", + "size": 702, + "isDebug": true + }, { "name": "Component.js", "module": "library/h/components/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -41,12 +46,12 @@ { "name": "TodoComponent.js", "module": "library/h/components/TodoComponent.js", - "size": 96, + "size": 54, "format": "raw" }, { "name": "resources.json", - "size": 3088 + "size": 3462 }, { "name": "subcomponent1/Component-dbg.js", @@ -60,7 +65,7 @@ { "name": "subcomponent1/Component-preload.js", "module": "library/h/components/subcomponent1/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -69,10 +74,15 @@ "library/h/components/subcomponent1/Component.js" ] }, + { + "name": "subcomponent1/Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "subcomponent1/Component.js", "module": "library/h/components/subcomponent1/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -89,7 +99,7 @@ { "name": "subcomponent2/Component-preload.js", "module": "library/h/components/subcomponent2/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -98,10 +108,15 @@ "library/h/components/subcomponent2/Component.js" ] }, + { + "name": "subcomponent2/Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "subcomponent2/Component.js", "module": "library/h/components/subcomponent2/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -118,7 +133,7 @@ { "name": "subcomponent3/Component-preload.js", "module": "library/h/components/subcomponent3/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -127,10 +142,15 @@ "library/h/components/subcomponent3/Component.js" ] }, + { + "name": "subcomponent3/Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "subcomponent3/Component.js", "module": "library/h/components/subcomponent3/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js index 464e003a7..4e08fd2af 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js @@ -1,6 +1,7 @@ //@ui5-bundle library/h/components/subcomponent1/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent1/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/subcomponent1/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js.map new file mode 100644 index 000000000..cb1cd3f0a --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json index 229bc59ec..3cb004e6c 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent1/resources.json @@ -13,7 +13,7 @@ { "name": "Component-preload.js", "module": "library/h/components/subcomponent1/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -22,17 +22,22 @@ "library/h/components/subcomponent1/Component.js" ] }, + { + "name": "Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "Component.js", "module": "library/h/components/subcomponent1/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] }, { "name": "resources.json", - "size": 745 + "size": 828 } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js index ef751b6d7..854db6f10 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js @@ -1,6 +1,7 @@ //@ui5-bundle library/h/components/subcomponent2/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent2/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/subcomponent2/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js.map new file mode 100644 index 000000000..cb1cd3f0a --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json index 51c37a4d5..55964fad6 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent2/resources.json @@ -13,7 +13,7 @@ { "name": "Component-preload.js", "module": "library/h/components/subcomponent2/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -22,17 +22,22 @@ "library/h/components/subcomponent2/Component.js" ] }, + { + "name": "Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "Component.js", "module": "library/h/components/subcomponent2/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] }, { "name": "resources.json", - "size": 745 + "size": 828 } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js index 55db04d3d..b37a05f21 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js @@ -1,6 +1,7 @@ //@ui5-bundle library/h/components/subcomponent3/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent3/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/subcomponent3/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js.map new file mode 100644 index 000000000..cb1cd3f0a --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json index 55fc009c5..6ca9bb8e6 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/components/subcomponent3/resources.json @@ -13,7 +13,7 @@ { "name": "Component-preload.js", "module": "library/h/components/subcomponent3/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -22,17 +22,22 @@ "library/h/components/subcomponent3/Component.js" ] }, + { + "name": "Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "Component.js", "module": "library/h/components/subcomponent3/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] }, { "name": "resources.json", - "size": 745 + "size": 828 } ] } \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js index 1746a7a97..b98361666 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js @@ -1,16 +1,19 @@ //@ui5-bundle library/h/customBundle-dbg.js sap.ui.require.preload({ - "library/h/file.js":function(){/*! + "library/h/file.js":function(){ +/*! * Some fancy copyright */ console.log(' File '); }, - "library/h/library.js":function(){/*! + "library/h/library.js":function(){ +/*! * Some fancy copyright */ console.log(' Library '); }, - "library/h/some.js":function(){/*! + "library/h/some.js":function(){ +/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js @@ -22,3 +25,4 @@ console.log(' Some '); * Some fancy copyright */ console.log(' Not including '); +//# sourceMappingURL=customBundle-dbg.js.map diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js.map new file mode 100644 index 000000000..f9420d627 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle-dbg.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle-dbg.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["file-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["library-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["not-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js index 40bf0e991..336248ee2 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js @@ -1,23 +1,23 @@ //@ui5-bundle library/h/customBundle.js sap.ui.require.preload({ - "library/h/file.js":function(){/*! + "library/h/file.js":function(){ +/*! * Some fancy copyright */ console.log(" File "); -//# sourceMappingURL=file.js.map }, - "library/h/library.js":function(){/*! + "library/h/library.js":function(){ +/*! * Some fancy copyright */ console.log(" Library "); -//# sourceMappingURL=library.js.map }, - "library/h/some.js":function(){/*! + "library/h/some.js":function(){ +/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js console.log(" Some "); -//# sourceMappingURL=some.js.map } }); //@ui5-bundle-raw-include library/h/not.js @@ -25,4 +25,4 @@ console.log(" Some "); * Some fancy copyright */ console.log(" Not including "); -//# sourceMappingURL=not.js.map \ No newline at end of file +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js.map b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js.map new file mode 100644 index 000000000..4a3b67496 --- /dev/null +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["file-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"file.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["library-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"library.js","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;;AAIAA,QAAQC,IAAI","file":"some.js","sourceRoot":""}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["not-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"not.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js index 530ba01e1..9b135171d 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/designtime/library.designtime.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -var myexport=function(){"use strict";String("asd")}(); -//# sourceMappingURL=library.designtime.js.map \ No newline at end of file +var myexport=function(){"use strict";String("asd")}(); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js index 2fe4c2aae..bcf866e67 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/file.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" File "); -//# sourceMappingURL=file.js.map \ No newline at end of file +console.log(" File "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js index ce760e5cb..6900e2218 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/library.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" Library "); -//# sourceMappingURL=library.js.map \ No newline at end of file +console.log(" Library "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js index 75a862b14..c249a10c8 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/not.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" Not including "); -//# sourceMappingURL=not.js.map \ No newline at end of file +console.log(" Not including "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json b/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json index f1a4d86f0..84806ccc3 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/resources.json @@ -17,7 +17,7 @@ { "name": "components/Component-preload.js", "module": "library/h/components/Component-preload.js", - "size": 441, + "size": 409, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -27,10 +27,15 @@ "library/h/components/TodoComponent.js" ] }, + { + "name": "components/Component-preload.js.map", + "size": 702, + "isDebug": true + }, { "name": "components/Component.js", "module": "library/h/components/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -45,7 +50,7 @@ { "name": "components/TodoComponent.js", "module": "library/h/components/TodoComponent.js", - "size": 96, + "size": 54, "format": "raw" }, { @@ -60,7 +65,7 @@ { "name": "components/subcomponent1/Component-preload.js", "module": "library/h/components/subcomponent1/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -69,10 +74,15 @@ "library/h/components/subcomponent1/Component.js" ] }, + { + "name": "components/subcomponent1/Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "components/subcomponent1/Component.js", "module": "library/h/components/subcomponent1/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -89,7 +99,7 @@ { "name": "components/subcomponent2/Component-preload.js", "module": "library/h/components/subcomponent2/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -98,10 +108,15 @@ "library/h/components/subcomponent2/Component.js" ] }, + { + "name": "components/subcomponent2/Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "components/subcomponent2/Component.js", "module": "library/h/components/subcomponent2/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -118,7 +133,7 @@ { "name": "components/subcomponent3/Component-preload.js", "module": "library/h/components/subcomponent3/Component-preload.js", - "size": 317, + "size": 326, "merged": true, "required": [ "sap/ui/core/UIComponent.js" @@ -127,10 +142,15 @@ "library/h/components/subcomponent3/Component.js" ] }, + { + "name": "components/subcomponent3/Component-preload.js.map", + "size": 509, + "isDebug": true + }, { "name": "components/subcomponent3/Component.js", "module": "library/h/components/subcomponent3/Component.js", - "size": 153, + "size": 115, "required": [ "sap/ui/core/UIComponent.js" ] @@ -138,7 +158,7 @@ { "name": "customBundle-dbg.js", "module": "library/h/customBundle.js", - "size": 500, + "size": 548, "isDebug": true, "merged": true, "included": [ @@ -149,10 +169,15 @@ "library/h/not.js" ] }, + { + "name": "customBundle-dbg.js.map", + "size": 784, + "isDebug": true + }, { "name": "customBundle.js", "module": "library/h/customBundle.js", - "size": 629, + "size": 540, "merged": true, "included": [ "library/h/file.js", @@ -162,6 +187,11 @@ "library/h/not.js" ] }, + { + "name": "customBundle.js.map", + "size": 942, + "isDebug": true + }, { "name": "designtime/library-dbg.designtime.js", "module": "library/h/designtime/library.designtime.js", @@ -177,7 +207,7 @@ { "name": "designtime/library.designtime.js", "module": "library/h/designtime/library.designtime.js", - "size": 133, + "size": 86, "requiresTopLevelScope": true, "exposedGlobalNames": [ "myexport" @@ -195,7 +225,7 @@ { "name": "file.js", "module": "library/h/file.js", - "size": 87, + "size": 54, "format": "raw" }, { @@ -222,7 +252,7 @@ { "name": "library.js", "module": "library/h/library.js", - "size": 93, + "size": 57, "format": "raw" }, { @@ -240,12 +270,12 @@ { "name": "not.js", "module": "library/h/not.js", - "size": 95, + "size": 63, "format": "raw" }, { "name": "resources.json", - "size": 5873 + "size": 6449 }, { "name": "some-dbg.js", @@ -261,7 +291,7 @@ { "name": "some.js", "module": "library/h/some.js", - "size": 132, + "size": 99, "format": "raw", "merged": true, "included": [ diff --git a/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js b/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js index 0c5f5d3e3..1e86f9afc 100644 --- a/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js +++ b/test/expected/build/library.h/dest-resources-json/resources/library/h/some.js @@ -2,5 +2,4 @@ * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js -console.log(" Some "); -//# sourceMappingURL=some.js.map \ No newline at end of file +console.log(" Some "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js index 58530f541..416739324 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js @@ -1,12 +1,13 @@ //@ui5-bundle library/h/components/Component-preload.js sap.ui.require.preload({ - "library/h/components/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); }, - "library/h/components/TodoComponent.js":function(){/*! + "library/h/components/TodoComponent.js":function(){ +/*! * Some fancy copyright */ console.log(" File "); -//# sourceMappingURL=TodoComponent.js.map } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js.map b/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js.map new file mode 100644 index 000000000..41305e36f --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["TodoComponent-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"TodoComponent.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js index f58e632b3..bcf866e67 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/TodoComponent.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" File "); -//# sourceMappingURL=TodoComponent.js.map \ No newline at end of file +console.log(" File "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js index 464e003a7..4e08fd2af 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js @@ -1,6 +1,7 @@ //@ui5-bundle library/h/components/subcomponent1/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent1/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/subcomponent1/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js.map b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js.map new file mode 100644 index 000000000..cb1cd3f0a --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent1/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js index ef751b6d7..854db6f10 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js @@ -1,6 +1,7 @@ //@ui5-bundle library/h/components/subcomponent2/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent2/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/subcomponent2/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js.map b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js.map new file mode 100644 index 000000000..cb1cd3f0a --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent2/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js index 55db04d3d..b37a05f21 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js @@ -1,6 +1,7 @@ //@ui5-bundle library/h/components/subcomponent3/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent3/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map + "library/h/components/subcomponent3/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js.map b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js.map new file mode 100644 index 000000000..cb1cd3f0a --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js index 04d854984..422a97071 100644 --- a/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js +++ b/test/expected/build/library.h/dest/resources/library/h/components/subcomponent3/Component.js @@ -1,2 +1 @@ -sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); -//# sourceMappingURL=Component.js.map \ No newline at end of file +sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{})}); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js b/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js index 1746a7a97..b98361666 100644 --- a/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js +++ b/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js @@ -1,16 +1,19 @@ //@ui5-bundle library/h/customBundle-dbg.js sap.ui.require.preload({ - "library/h/file.js":function(){/*! + "library/h/file.js":function(){ +/*! * Some fancy copyright */ console.log(' File '); }, - "library/h/library.js":function(){/*! + "library/h/library.js":function(){ +/*! * Some fancy copyright */ console.log(' Library '); }, - "library/h/some.js":function(){/*! + "library/h/some.js":function(){ +/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js @@ -22,3 +25,4 @@ console.log(' Some '); * Some fancy copyright */ console.log(' Not including '); +//# sourceMappingURL=customBundle-dbg.js.map diff --git a/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js.map b/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js.map new file mode 100644 index 000000000..f9420d627 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/customBundle-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle-dbg.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle-dbg.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["file-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["library-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["not-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/customBundle.js b/test/expected/build/library.h/dest/resources/library/h/customBundle.js index 40bf0e991..336248ee2 100644 --- a/test/expected/build/library.h/dest/resources/library/h/customBundle.js +++ b/test/expected/build/library.h/dest/resources/library/h/customBundle.js @@ -1,23 +1,23 @@ //@ui5-bundle library/h/customBundle.js sap.ui.require.preload({ - "library/h/file.js":function(){/*! + "library/h/file.js":function(){ +/*! * Some fancy copyright */ console.log(" File "); -//# sourceMappingURL=file.js.map }, - "library/h/library.js":function(){/*! + "library/h/library.js":function(){ +/*! * Some fancy copyright */ console.log(" Library "); -//# sourceMappingURL=library.js.map }, - "library/h/some.js":function(){/*! + "library/h/some.js":function(){ +/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js console.log(" Some "); -//# sourceMappingURL=some.js.map } }); //@ui5-bundle-raw-include library/h/not.js @@ -25,4 +25,4 @@ console.log(" Some "); * Some fancy copyright */ console.log(" Not including "); -//# sourceMappingURL=not.js.map \ No newline at end of file +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/library.h/dest/resources/library/h/customBundle.js.map b/test/expected/build/library.h/dest/resources/library/h/customBundle.js.map new file mode 100644 index 000000000..4a3b67496 --- /dev/null +++ b/test/expected/build/library.h/dest/resources/library/h/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["file-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"file.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["library-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"library.js","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;;AAIAA,QAAQC,IAAI","file":"some.js","sourceRoot":""}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["not-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"not.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js b/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js index 530ba01e1..9b135171d 100644 --- a/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js +++ b/test/expected/build/library.h/dest/resources/library/h/designtime/library.designtime.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -var myexport=function(){"use strict";String("asd")}(); -//# sourceMappingURL=library.designtime.js.map \ No newline at end of file +var myexport=function(){"use strict";String("asd")}(); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/file.js b/test/expected/build/library.h/dest/resources/library/h/file.js index 2fe4c2aae..bcf866e67 100644 --- a/test/expected/build/library.h/dest/resources/library/h/file.js +++ b/test/expected/build/library.h/dest/resources/library/h/file.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" File "); -//# sourceMappingURL=file.js.map \ No newline at end of file +console.log(" File "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/library.js b/test/expected/build/library.h/dest/resources/library/h/library.js index ce760e5cb..6900e2218 100644 --- a/test/expected/build/library.h/dest/resources/library/h/library.js +++ b/test/expected/build/library.h/dest/resources/library/h/library.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" Library "); -//# sourceMappingURL=library.js.map \ No newline at end of file +console.log(" Library "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/not.js b/test/expected/build/library.h/dest/resources/library/h/not.js index 75a862b14..c249a10c8 100644 --- a/test/expected/build/library.h/dest/resources/library/h/not.js +++ b/test/expected/build/library.h/dest/resources/library/h/not.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log(" Not including "); -//# sourceMappingURL=not.js.map \ No newline at end of file +console.log(" Not including "); \ No newline at end of file diff --git a/test/expected/build/library.h/dest/resources/library/h/some.js b/test/expected/build/library.h/dest/resources/library/h/some.js index 0c5f5d3e3..1e86f9afc 100644 --- a/test/expected/build/library.h/dest/resources/library/h/some.js +++ b/test/expected/build/library.h/dest/resources/library/h/some.js @@ -2,5 +2,4 @@ * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js -console.log(" Some "); -//# sourceMappingURL=some.js.map \ No newline at end of file +console.log(" Some "); \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js index 1ca867689..c2ba18606 100644 --- a/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js @@ -1,14 +1,17 @@ //@ui5-bundle library/h/components/Component-preload.js sap.ui.require.preload({ - "library/h/components/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "library/h/components/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.g.Component', { }); }); }, - "library/h/components/TodoComponent.js":function(){/*! + "library/h/components/TodoComponent.js":function(){ +/*! * Some fancy copyright */ console.log(' File '); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js.map b/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js.map new file mode 100644 index 000000000..baa7012c8 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["TodoComponent.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js index 40b2828bc..d2aff44c1 100644 --- a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js @@ -1,9 +1,11 @@ //@ui5-bundle library/h/components/subcomponent1/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent1/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "library/h/components/subcomponent1/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.g.Component', { }); }); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js.map b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js.map new file mode 100644 index 000000000..ee8821bdb --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent1/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js index 0e338e1ba..03abae7d8 100644 --- a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js @@ -1,9 +1,11 @@ //@ui5-bundle library/h/components/subcomponent2/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent2/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "library/h/components/subcomponent2/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.g.Component', { }); }); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js.map b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js.map new file mode 100644 index 000000000..ee8821bdb --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent2/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js index 42cadcd83..f6c0783c0 100644 --- a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js @@ -1,9 +1,11 @@ //@ui5-bundle library/h/components/subcomponent3/Component-preload.js sap.ui.require.preload({ - "library/h/components/subcomponent3/Component.js":function(){sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ + "library/h/components/subcomponent3/Component.js":function(){ +sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; return UIComponent.extend('application.g.Component', { }); }); } }); +//# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js.map b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js.map new file mode 100644 index 000000000..ee8821bdb --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/components/subcomponent3/Component-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js b/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js index 1746a7a97..b98361666 100644 --- a/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js +++ b/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js @@ -1,16 +1,19 @@ //@ui5-bundle library/h/customBundle-dbg.js sap.ui.require.preload({ - "library/h/file.js":function(){/*! + "library/h/file.js":function(){ +/*! * Some fancy copyright */ console.log(' File '); }, - "library/h/library.js":function(){/*! + "library/h/library.js":function(){ +/*! * Some fancy copyright */ console.log(' Library '); }, - "library/h/some.js":function(){/*! + "library/h/some.js":function(){ +/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js @@ -22,3 +25,4 @@ console.log(' Some '); * Some fancy copyright */ console.log(' Not including '); +//# sourceMappingURL=customBundle-dbg.js.map diff --git a/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js.map b/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js.map new file mode 100644 index 000000000..26839da42 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/customBundle-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle-dbg.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle-dbg.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["file.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["library.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["some.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["not.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js b/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js index 8c6d93a0b..380250bbe 100644 --- a/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js +++ b/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js @@ -1,16 +1,19 @@ //@ui5-bundle library/h/customBundle.js sap.ui.require.preload({ - "library/h/file.js":function(){/*! + "library/h/file.js":function(){ +/*! * Some fancy copyright */ console.log(' File '); }, - "library/h/library.js":function(){/*! + "library/h/library.js":function(){ +/*! * Some fancy copyright */ console.log(' Library '); }, - "library/h/some.js":function(){/*! + "library/h/some.js":function(){ +/*! * Some fancy copyright */ //@ui5-bundle-raw-include library/h/other.js @@ -22,3 +25,4 @@ console.log(' Some '); * Some fancy copyright */ console.log(' Not including '); +//# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js.map b/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js.map new file mode 100644 index 000000000..3a2f6c0e8 --- /dev/null +++ b/test/expected/build/library.h/no-minify/resources/library/h/customBundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["file.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["library.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["some.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":23,"column":0},"map":{"version":3,"sources":["not.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/some.js b/test/expected/build/library.l/dest/resources/library/l/some.js index bf4a8a469..82357c2d4 100644 --- a/test/expected/build/library.l/dest/resources/library/l/some.js +++ b/test/expected/build/library.l/dest/resources/library/l/some.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -sap.ui.define([],function(){"use strict";var i=function(){}},true); -//# sourceMappingURL=some.js.map \ No newline at end of file +sap.ui.define([],function(){"use strict";var i=function(){}},true); \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/subdir/index.js b/test/expected/build/library.l/dest/resources/library/l/subdir/index.js index 9661d7207..894e5374f 100644 --- a/test/expected/build/library.l/dest/resources/library/l/subdir/index.js +++ b/test/expected/build/library.l/dest/resources/library/l/subdir/index.js @@ -1,2 +1 @@ -function hello(l){console.log("hello "+l)}hello("world"); -//# sourceMappingURL=index.js.map \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file diff --git a/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js b/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js index 7b3311e4e..894e5374f 100644 --- a/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js +++ b/test/expected/build/library.l/dest/resources/library/l/subdir/thirdparty/File1.js @@ -1,2 +1 @@ -function hello(l){console.log("hello "+l)}hello("world"); -//# sourceMappingURL=File1.js.map \ No newline at end of file +function hello(l){console.log("hello "+l)}hello("world"); \ No newline at end of file diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" index 7b9c787c6..0a38dc7b0 100644 --- "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js" @@ -1,10 +1,11 @@ //@ui5-bundle library/ø/library-preload.js sap.ui.require.preload({ "library/ø/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"library.ø","type":"library","embeds":[],"applicationVersion":{"version":"1.0.0"},"title":"Library Ø","description":"Library Ø","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":["цветя"]},"sap.ui5":{"dependencies":{"minUI5Version":"1.0","libs":{}},"library":{"i18n":false}}}', - "library/ø/some.js":function(){/*! + "library/ø/some.js":function(){ +/*! * Some fancy copyright */ (function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map } }); +//# sourceMappingURL=library-preload.js.map diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js.map" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js.map" new file mode 100644 index 000000000..ba9e10c92 --- /dev/null +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.js.map" @@ -0,0 +1 @@ +{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":4,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"names":["someNonUglifiedVariable","console","log"],"mappings":"AAAA;;;CAGA,WACC,IAAIA,EAA0B,QAC9BC,QAAQC,IAAI,SAAWF,IAFxB","file":"some.js","sourceRoot":""}}]} \ No newline at end of file diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" index 9dd152223..a4cbccba8 100644 --- "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js" @@ -35,3 +35,4 @@ ]; }, true); +//# sourceMappingURL=library-preload.support.js.map diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js.map" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js.map" new file mode 100644 index 000000000..be89c1e24 --- /dev/null +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/library-preload.support.js.map" @@ -0,0 +1 @@ +{"version":3,"file":"library-preload.support.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["MyControl.support.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"rules"}}]} \ No newline at end of file diff --git "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" index 75aba1e23..c23f5f207 100644 --- "a/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" +++ "b/test/expected/build/library.\303\270/dest/resources/library/\303\270/some.js" @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -(function(){var o="World";console.log("Hello "+o)})(); -//# sourceMappingURL=some.js.map \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js index a72d46525..e69de29bb 100644 --- a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap-ui-core.js @@ -1,2 +0,0 @@ - -//# sourceMappingURL=sap-ui-core.js.map \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js index e0fe65e6f..b37fec15d 100644 --- a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/Global.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log("20220620-1630"); -//# sourceMappingURL=Global.js.map \ No newline at end of file +console.log("20220620-1630"); \ No newline at end of file diff --git a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js index e625a5c05..607c2f2f2 100644 --- a/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js +++ b/test/expected/build/sap.ui.core-buildtime/dest/resources/sap/ui/core/Core.js @@ -1,5 +1,4 @@ /*! * Some fancy copyright */ -console.log("${buildtime}"); -//# sourceMappingURL=Core.js.map \ No newline at end of file +console.log("${buildtime}"); \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js index 032851a0c..2a2414795 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js @@ -7,3 +7,4 @@ sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); +//# sourceMappingURL=sap-ui-core-dbg.js.map diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js.map b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js.map new file mode 100644 index 000000000..42fc15159 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-core-dbg.js","sections":[{"offset":{"line":2,"column":0},"map":{"version":3,"sources":["ui5loader-autoconfig-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["sap-ui-core-dbg.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.requireSync(\"sap/ui/core/Core\");\n"],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["sap-ui-core-dbg.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["// as this module contains the Core, we ensure that the Core has been booted\nsap.ui.getCore().boot && sap.ui.getCore().boot();"],"sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js index 0586fc05a..b5a8e28a4 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js @@ -7,3 +7,4 @@ sap.ui.requireSync("sap/ui/core/Core"); // as this module contains the Core, we ensure that the Core has been booted sap.ui.getCore().boot && sap.ui.getCore().boot(); +//# sourceMappingURL=sap-ui-core-nojQuery-dbg.js.map diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js.map b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js.map new file mode 100644 index 000000000..d6f967ff5 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery-dbg.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-core-nojQuery-dbg.js","sections":[{"offset":{"line":2,"column":0},"map":{"version":3,"sources":["ui5loader-autoconfig-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["sap-ui-core-nojQuery-dbg.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.requireSync(\"sap/ui/core/Core\");\n"],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["sap-ui-core-nojQuery-dbg.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["// as this module contains the Core, we ensure that the Core has been booted\nsap.ui.getCore().boot && sap.ui.getCore().boot();"],"sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js index f5f9001c0..14731c9fe 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js @@ -3,10 +3,9 @@ window["sap-ui-optimized"] = true; try { //@ui5-bundle-raw-include ui5loader-autoconfig.js (function(){var o=true;console.log(o)})(); -//# sourceMappingURL=ui5loader-autoconfig.js.map sap.ui.require.preload({ - "sap/ui/core/Core.js":function(){(function(){var o=true;console.log(o)})(); -//# sourceMappingURL=Core.js.map + "sap/ui/core/Core.js":function(){ +(function(){var o=true;console.log(o)})(); } }); sap.ui.requireSync("sap/ui/core/Core"); @@ -15,3 +14,4 @@ sap.ui.getCore().boot && sap.ui.getCore().boot(); } catch(oError) { if (oError.name != "Restart") { throw oError; } } +//# sourceMappingURL=sap-ui-core-nojQuery.js.map diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js.map b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js.map new file mode 100644 index 000000000..ca9a8e492 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core-nojQuery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-core-nojQuery.js","sections":[{"offset":{"line":4,"column":0},"map":{"version":3,"sources":["ui5loader-autoconfig-dbg.js"],"names":["thisIsTheUi5LoaderAutoconfig","console","log"],"mappings":"CAAA,WACC,IAAIA,EAA+B,KACnCC,QAAQC,IAAIF,IAFb","file":"ui5loader-autoconfig.js","sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["sap-ui-core-nojQuery.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["Core-dbg.js"],"names":["core","console","log"],"mappings":"CAAA,WACC,IAAIA,EAAO,KACXC,QAAQC,IAAIF,IAFb","file":"Core.js","sourceRoot":"sap/ui/core"}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["sap-ui-core-nojQuery.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.requireSync(\"sap/ui/core/Core\");\n"],"sourceRoot":""}},{"offset":{"line":11,"column":0},"map":{"version":3,"sources":["sap-ui-core-nojQuery.js?bundle-code-2"],"mappings":"AAAA;AACA","sourcesContent":["// as this module contains the Core, we ensure that the Core has been booted\nsap.ui.getCore().boot && sap.ui.getCore().boot();"],"sourceRoot":""}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["sap-ui-core-nojQuery.js?bundle-code-3"],"mappings":"AAAA;AACA;AACA","sourcesContent":["} catch(oError) {\nif (oError.name != \"Restart\") { throw oError; }\n}"],"sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js index d3a111a16..bf5d44549 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js @@ -3,10 +3,9 @@ window["sap-ui-optimized"] = true; try { //@ui5-bundle-raw-include ui5loader-autoconfig.js (function(){var o=true;console.log(o)})(); -//# sourceMappingURL=ui5loader-autoconfig.js.map sap.ui.require.preload({ - "sap/ui/core/Core.js":function(){(function(){var o=true;console.log(o)})(); -//# sourceMappingURL=Core.js.map + "sap/ui/core/Core.js":function(){ +(function(){var o=true;console.log(o)})(); } }); sap.ui.requireSync("sap/ui/core/Core"); @@ -15,3 +14,4 @@ sap.ui.getCore().boot && sap.ui.getCore().boot(); } catch(oError) { if (oError.name != "Restart") { throw oError; } } +//# sourceMappingURL=sap-ui-core.js.map diff --git a/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map new file mode 100644 index 000000000..dcfd83f5d --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap-ui-core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sap-ui-core.js","sections":[{"offset":{"line":4,"column":0},"map":{"version":3,"sources":["ui5loader-autoconfig-dbg.js"],"names":["thisIsTheUi5LoaderAutoconfig","console","log"],"mappings":"CAAA,WACC,IAAIA,EAA+B,KACnCC,QAAQC,IAAIF,IAFb","file":"ui5loader-autoconfig.js","sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["sap-ui-core.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["Core-dbg.js"],"names":["core","console","log"],"mappings":"CAAA,WACC,IAAIA,EAAO,KACXC,QAAQC,IAAIF,IAFb","file":"Core.js","sourceRoot":"sap/ui/core"}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["sap-ui-core.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.requireSync(\"sap/ui/core/Core\");\n"],"sourceRoot":""}},{"offset":{"line":11,"column":0},"map":{"version":3,"sources":["sap-ui-core.js?bundle-code-2"],"mappings":"AAAA;AACA","sourcesContent":["// as this module contains the Core, we ensure that the Core has been booted\nsap.ui.getCore().boot && sap.ui.getCore().boot();"],"sourceRoot":""}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["sap-ui-core.js?bundle-code-3"],"mappings":"AAAA;AACA;AACA","sourcesContent":["} catch(oError) {\nif (oError.name != \"Restart\") { throw oError; }\n}"],"sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js index 29a53cc7e..dd81f8b0e 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/Core.js @@ -1,2 +1 @@ -(function(){var o=true;console.log(o)})(); -//# sourceMappingURL=Core.js.map \ No newline at end of file +(function(){var o=true;console.log(o)})(); \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js index 19e93a36a..d368503ac 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js @@ -1,16 +1,17 @@ //@ui5-bundle sap/ui/core/library-preload.js sap.ui.require.preload({ - "sap/ui/core/one.js":function(){function One(){return 1} -//# sourceMappingURL=one.js.map + "sap/ui/core/one.js":function(){ +function One(){return 1} this.One=One; }, - "sap/ui/core/some.js":function(){/*! + "sap/ui/core/some.js":function(){ +/*! * ${copyright} */ console.log("HelloWorld"); -//# sourceMappingURL=some.js.map }, - "ui5loader.js":function(){(function(){var o=true;console.log(o)})(); -//# sourceMappingURL=ui5loader.js.map + "ui5loader.js":function(){ +(function(){var o=true;console.log(o)})(); } }); +//# sourceMappingURL=library-preload.js.map diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js.map b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js.map new file mode 100644 index 000000000..e22c32c23 --- /dev/null +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/library-preload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["one-dbg.js"],"names":["One"],"mappings":"AAAA,SAASA,MACR,OAAO","file":"one.js","sourceRoot":""}},{"offset":{"line":4,"column":0},"map":{"version":3,"sources":["library-preload.js?bundle-code-1"],"mappings":"AAAA;AACA","sourcesContent":["this.One=One;\n"],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["some-dbg.js"],"names":["console","log"],"mappings":"AAAA;;;AAGAA,QAAQC,IAAI","file":"some.js","sourceRoot":""}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["ui5loader-dbg.js"],"names":["thisIsTheUi5Loader","console","log"],"mappings":"CAAA,WACC,IAAIA,EAAqB,KACzBC,QAAQC,IAAIF,IAFb","file":"ui5loader.js","sourceRoot":"../../.."}}]} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js index 7a53557c1..5aa630fcf 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/one.js @@ -1,2 +1 @@ -function One(){return 1} -//# sourceMappingURL=one.js.map \ No newline at end of file +function One(){return 1} \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js index 66f0541d6..f4ab0a202 100644 --- a/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js +++ b/test/expected/build/sap.ui.core/preload/resources/sap/ui/core/some.js @@ -1,5 +1,4 @@ /*! * ${copyright} */ -console.log("HelloWorld"); -//# sourceMappingURL=some.js.map \ No newline at end of file +console.log("HelloWorld"); \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js index 3cedd755e..dd81f8b0e 100644 --- a/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader-autoconfig.js @@ -1,2 +1 @@ -(function(){var o=true;console.log(o)})(); -//# sourceMappingURL=ui5loader-autoconfig.js.map \ No newline at end of file +(function(){var o=true;console.log(o)})(); \ No newline at end of file diff --git a/test/expected/build/sap.ui.core/preload/resources/ui5loader.js b/test/expected/build/sap.ui.core/preload/resources/ui5loader.js index 863578d3d..dd81f8b0e 100644 --- a/test/expected/build/sap.ui.core/preload/resources/ui5loader.js +++ b/test/expected/build/sap.ui.core/preload/resources/ui5loader.js @@ -1,2 +1 @@ -(function(){var o=true;console.log(o)})(); -//# sourceMappingURL=ui5loader.js.map \ No newline at end of file +(function(){var o=true;console.log(o)})(); \ No newline at end of file diff --git a/test/fixtures/application.h/ui5.yaml b/test/fixtures/application.h/ui5.yaml deleted file mode 100644 index 9365040dc..000000000 --- a/test/fixtures/application.h/ui5.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -specVersion: "2.0" -type: application -metadata: - name: application.h -builder: - bundles: - - name: sap/ushell/bootstrap/cdm.js - defaultFileTypes: - - ".js" - sections: - - mode: raw - filters: - - ui5loader.js - - ui5loader-autoconfig.js - declareModules: false - resolve: true - - mode: preload - name: sap/ushell/bootstrap/common - filters: - - sap/ushell/bootstrap/cdm/cdm-def.js - resolve: true - - mode: require - filters: - - sap/ushell/bootstrap/cdm/cdm-def.js \ No newline at end of file diff --git a/test/fixtures/application.i/ui5.yaml b/test/fixtures/application.i/ui5.yaml deleted file mode 100644 index 7c526c7e8..000000000 --- a/test/fixtures/application.i/ui5.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -specVersion: "0.1" -type: application -metadata: - name: application.i -builder: - bundles: - - name: sap/ushell/bootstrap/cdm.js - defaultFileTypes: - - ".js" - sections: - - mode: raw - filters: - - ui5loader.js - - ui5loader-autoconfig.js - declareModules: false - resolve: true - - mode: preload - name: sap/ushell/bootstrap/common - filters: - - sap/ushell/bootstrap/cdm/cdm-def.js - resolve: true - - mode: require - filters: - - sap/ushell/bootstrap/cdm/cdm-def.js \ No newline at end of file diff --git a/test/fixtures/application.j/ui5.yaml b/test/fixtures/application.j/ui5.yaml deleted file mode 100644 index 5cc8b006d..000000000 --- a/test/fixtures/application.j/ui5.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -specVersion: "0.1" -type: application -metadata: - name: application.j -builder: - bundles: - - name: sap/ushell/bootstrap/cdm.js - defaultFileTypes: - - ".js" - sections: - - mode: raw - filters: - - ui5loader.js - - ui5loader-autoconfig.js - declareModules: false - resolve: true - - mode: preload - name: sap/ushell/bootstrap/common - filters: - - sap/ushell/bootstrap/cdm/cdm-def.js - resolve: true - - mode: require - filters: - - sap/ushell/bootstrap/cdm/cdm-def.js diff --git "a/test/fixtures/application.\303\270/ui5.yaml" "b/test/fixtures/application.\303\270/ui5.yaml" deleted file mode 100644 index 67342283e..000000000 --- "a/test/fixtures/application.\303\270/ui5.yaml" +++ /dev/null @@ -1,9 +0,0 @@ ---- -specVersion: "2.0" -type: application -metadata: - name: application.ø -resources: - configuration: - paths: - webapp: wêbäpp diff --git a/test/lib/builder/builder.js b/test/lib/builder/builder.js index e19f78766..6b9403a1a 100644 --- a/test/lib/builder/builder.js +++ b/test/lib/builder/builder.js @@ -901,7 +901,7 @@ test.serial("Build library.ø", (t) => { }); test.serial("Build library.coreBuildtime: replaceBuildtime", (t) => { - const destPath = path.join("test", "tmp", "build", "library.coreBuildtime", "dest"); + const destPath = path.join("test", "tmp", "build", "sap.ui.core-buildtime", "dest"); const expectedPath = path.join("test", "expected", "build", "sap.ui.core-buildtime", "dest"); const dateStubs = [ diff --git a/test/lib/lbt/bundle/Builder.js b/test/lib/lbt/bundle/Builder.js index c6146a75d..19dd58518 100644 --- a/test/lib/lbt/bundle/Builder.js +++ b/test/lib/lbt/bundle/Builder.js @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ const test = require("ava"); const sinon = require("sinon"); const mock = require("mock-require"); @@ -5,6 +6,11 @@ const mock = require("mock-require"); const Builder = require("../../../../lib/lbt/bundle/Builder"); const ResourcePool = require("../../../../lib/lbt/resources/ResourcePool"); +// Node.js itself tries to parse sourceMappingURLs in all JavaScript files. This is unwanted and might even lead to +// obscure errors when dynamically generating Data-URI soruceMappingURL values. +// Therefore use this constant to never write the actual string. +const SOURCE_MAPPING_URL = "//" + "# sourceMappingURL"; + test.afterEach.always((t) => { mock.stopAll(); sinon.restore(); @@ -39,7 +45,6 @@ test.serial("writePreloadModule: with invalid json content", async (t) => { }; const result = await builder.writePreloadModule("invalid.json", undefined, invalidJsonResource); - t.is(verboseLogStub.callCount, 2, "called 2 times"); t.is(verboseLogStub.firstCall.args[0], "Failed to parse JSON file %s. Ignoring error, skipping compression.", "first verbose log argument 0 is correct"); @@ -55,6 +60,7 @@ test("integration: createBundle with exposedGlobals", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "a.js", + getPath: () => "a.js", string: function() { return this.buffer(); }, @@ -62,6 +68,7 @@ test("integration: createBundle with exposedGlobals", async (t) => { }); pool.addResource({ name: "ui5loader.js", + getPath: () => "ui5loader.js", string: function() { return this.buffer(); }, @@ -69,6 +76,7 @@ test("integration: createBundle with exposedGlobals", async (t) => { }); pool.addResource({ name: "a.library", + getPath: () => "a.library", string: function() { return this.buffer(); }, @@ -103,11 +111,13 @@ test("integration: createBundle with exposedGlobals", async (t) => { t.deepEqual(oResult.name, "library-preload.js"); const expectedContent = `//@ui5-bundle library-preload.js sap.ui.require.preload({ - "a.js":function(){function One(){return 1;} + "a.js":function(){ +function One(){return 1;} this.One=One; } },"preload-section"); sap.ui.requireSync("ui5loader"); +${SOURCE_MAPPING_URL}=library-preload.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat " + "should contain:" + @@ -123,6 +133,7 @@ test("integration: createBundle EVOBundleFormat (ui5loader.js)", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + getPath: () => "ui5loader.js", string: function() { return this.buffer(); }, @@ -130,6 +141,7 @@ test("integration: createBundle EVOBundleFormat (ui5loader.js)", async (t) => { }); pool.addResource({ name: "jquery.sap.global-dbg.js", + getPath: () => "jquery.sap.global-dbg.js", string: function() { return this.buffer(); }, @@ -137,6 +149,7 @@ test("integration: createBundle EVOBundleFormat (ui5loader.js)", async (t) => { }); pool.addResource({ name: "myModule.js", + getPath: () => "myModule.js", string: function() { return this.buffer(); }, @@ -167,12 +180,14 @@ test("integration: createBundle EVOBundleFormat (ui5loader.js)", async (t) => { const expectedContent = `//@ui5-bundle Component-preload.js window["sap-ui-optimized"] = true; sap.ui.require.preload({ - "jquery.sap.global-dbg.js":function(){sap.ui.define([], function(){return {};}); + "jquery.sap.global-dbg.js":function(){ +sap.ui.define([], function(){return {};}); } },"preload-section"); //@ui5-bundle-raw-include myModule.js (function(){window.mine = {};}()); sap.ui.requireSync("ui5loader"); +${SOURCE_MAPPING_URL}=Component-preload.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + @@ -189,6 +204,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + getPath: () => "ui5loader.js", string: function() { return this.buffer(); }, @@ -196,6 +212,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ // the pool must contain this to activate optimization markers name: "jquery.sap.global-dbg.js", + getPath: () => "jquery.sap.global-dbg.js", string: function() { return this.buffer(); }, @@ -203,6 +220,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", string: function() { return this.buffer(); }, @@ -210,6 +228,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ name: "jquery.sap.pony1.js", + getPath: () => "jquery.sap.pony1.js", string: function() { return this.buffer(); }, @@ -217,6 +236,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ name: "jquery.sap.pony2.js", + getPath: () => "jquery.sap.pony2.js", string: function() { return this.buffer(); }, @@ -227,6 +247,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ name: "myRawModule.js", + getPath: () => "myRawModule.js", string: function() { return this.buffer(); }, @@ -234,6 +255,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( }); pool.addResource({ name: "myModuleUsingGlobalScope.js", + getPath: () => "myModuleUsingGlobalScope.js", string: function() { return this.buffer(); }, @@ -268,7 +290,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls", async ( usePredefineCalls: true, numberOfParts: 1, decorateBootstrapModule: true, - optimize: true // Note: using 'optimize' makes the test sensitive to changes in terser + optimize: true }); t.deepEqual(oResult.name, "Component-preload.js"); const expectedContent = `//@ui5-bundle Component-preload.js @@ -285,6 +307,7 @@ sap.ui.require.preload({ //@ui5-bundle-raw-include myRawModule.js (function(){window.mine = {};}()); sap.ui.requireSync("ui5loader"); +${SOURCE_MAPPING_URL}=Component-preload.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + @@ -307,6 +330,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + getPath: () => "ui5loader.js", string: function() { return this.buffer(); }, @@ -314,6 +338,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ // the pool must contain this to activate optimization markers name: "jquery.sap.global-dbg.js", + getPath: () => "jquery.sap.global-dbg.js", string: function() { return this.buffer(); }, @@ -321,6 +346,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", string: function() { return this.buffer(); }, @@ -328,6 +354,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ name: "jquery.sap.pony1.js", + getPath: () => "jquery.sap.pony1.js", string: function() { return this.buffer(); }, @@ -335,6 +362,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ name: "jquery.sap.pony2.js", + getPath: () => "jquery.sap.pony2.js", string: function() { return this.buffer(); }, @@ -345,6 +373,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ name: "myRawModule.js", + getPath: () => "myRawModule.js", string: function() { return this.buffer(); }, @@ -352,6 +381,7 @@ test("integration: createBundle EVOBundleFormat, using predefine calls, no optim }); pool.addResource({ name: "myModuleUsingGlobalScope.js", + getPath: () => "myModuleUsingGlobalScope.js", string: function() { return this.buffer(); }, @@ -403,6 +433,7 @@ sap.ui.require.preload({ //@ui5-bundle-raw-include myRawModule.js (function(){window.mine = {};}()); sap.ui.requireSync("ui5loader"); +${SOURCE_MAPPING_URL}=Component-preload.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + @@ -425,6 +456,7 @@ test("integration: createBundle (bootstrap bundle)", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "ui5loader.js", + getPath: () => "ui5loader.js", string: function() { return this.buffer(); }, @@ -432,6 +464,7 @@ test("integration: createBundle (bootstrap bundle)", async (t) => { }); pool.addResource({ name: "sap/ui/core/Core.js", + getPath: () => "sap/ui/core/Core.js", string: function() { return this.buffer(); }, @@ -477,6 +510,7 @@ sap.ui.getCore().boot && sap.ui.getCore().boot(); } catch(oError) { if (oError.name != "Restart") { throw oError; } } +${SOURCE_MAPPING_URL}=bootstrap.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + @@ -493,6 +527,7 @@ test("integration: createBundle UI5BundleFormat (non ui5loader.js)", async (t) = const pool = new ResourcePool(); pool.addResource({ name: "sap-ui-core.js", + getPath: () => "sap-ui-core.js", string: function() { return this.buffer(); }, @@ -500,6 +535,7 @@ test("integration: createBundle UI5BundleFormat (non ui5loader.js)", async (t) = }); pool.addResource({ name: "jquery.sap.global-dbg.js", + getPath: () => "jquery.sap.global-dbg.js", string: function() { return this.buffer(); }, @@ -507,6 +543,7 @@ test("integration: createBundle UI5BundleFormat (non ui5loader.js)", async (t) = }); pool.addResource({ name: "myModule.js", + getPath: () => "myModule.js", string: function() { return this.buffer(); }, @@ -539,12 +576,14 @@ jQuery.sap.registerPreloadedModules({ "name":"preload-section", "version":"2.0", "modules":{ - "jquery.sap.global-dbg.js":function(){sap.ui.define([], function(){/* comment */ return {};}); + "jquery.sap.global-dbg.js":function(){ +sap.ui.define([], function(){/* comment */ return {};}); } }}); //@ui5-bundle-raw-include myModule.js (function(){window.mine = {};}()); sap.ui.requireSync("sap-ui-core"); +${SOURCE_MAPPING_URL}=Component-preload.js.map `; t.deepEqual(oResult.content, expectedContent, "Ui5BundleFormat should start with registerPreloadedModules " + "and should contain:" + @@ -561,6 +600,7 @@ test("integration: createBundle (bootstrap bundle, UI5BundleFormat)", async (t) const pool = new ResourcePool(); pool.addResource({ name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", string: function() { return this.buffer(); }, @@ -568,6 +608,7 @@ test("integration: createBundle (bootstrap bundle, UI5BundleFormat)", async (t) }); pool.addResource({ name: "myRawModule.js", + getPath: () => "myRawModule.js", string: function() { return this.buffer(); }, @@ -575,6 +616,7 @@ test("integration: createBundle (bootstrap bundle, UI5BundleFormat)", async (t) }); pool.addResource({ name: "sap/ui/core/Core.js", + getPath: () => "sap/ui/core/Core.js", string: function() { return this.buffer(); }, @@ -624,6 +666,7 @@ sap.ui.getCore().boot && sap.ui.getCore().boot(); } catch(oError) { if (oError.name != "Restart") { throw oError; } } +${SOURCE_MAPPING_URL}=bootstrap.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat should start with optimization and " + "should contain:" + @@ -636,7 +679,7 @@ if (oError.name != "Restart") { throw oError; } "bundle info subModules are correct"); }); -test("integration: createBundle with bundleInfo", async (t) => { +test.serial("integration: createBundle with bundleInfo", async (t) => { const logger = require("@ui5/logger"); const verboseLogStub = sinon.stub(); const warnLogStub = sinon.stub(); @@ -650,6 +693,7 @@ test("integration: createBundle with bundleInfo", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "a.js", + getPath: () => "a.js", string: function() { return this.buffer(); }, @@ -657,6 +701,7 @@ test("integration: createBundle with bundleInfo", async (t) => { }); pool.addResource({ name: "b.js", + getPath: () => "b.js", string: function() { return this.buffer(); }, @@ -664,6 +709,7 @@ test("integration: createBundle with bundleInfo", async (t) => { }); pool.addResource({ name: "c.js", + getPath: () => "c.js", string: function() { return this.buffer(); }, @@ -671,6 +717,7 @@ test("integration: createBundle with bundleInfo", async (t) => { }); pool.addResource({ name: "ui5loader.js", + getPath: () => "ui5loader.js", string: function() { return this.buffer(); }, @@ -678,6 +725,7 @@ test("integration: createBundle with bundleInfo", async (t) => { }); pool.addResource({ name: "a.library", + getPath: () => "a.library", string: function() { return this.buffer(); }, @@ -720,7 +768,8 @@ test("integration: createBundle with bundleInfo", async (t) => { t.deepEqual(oResult.name, "library-preload.js"); const expectedContent = `//@ui5-bundle library-preload.js sap.ui.require.preload({ - "a.js":function(){function One(){return 1;} + "a.js":function(){ +function One(){return 1;} this.One=One; } },"preload-section"); @@ -729,6 +778,7 @@ sap.ui.loader.config({bundlesUI5:{ "my-custom-bundle":['b.js'], "my-other-custom-bundle.js":['c.js'] }}); +${SOURCE_MAPPING_URL}=library-preload.js.map `; t.deepEqual(oResult.content, expectedContent, "EVOBundleFormat " + "should contain:" + @@ -746,3 +796,1207 @@ sap.ui.loader.config({bundlesUI5:{ `The name must match the bundle filename (incl. extension such as '.js')` ]); }); + +test("integration: createBundle using predefine calls with source maps and a single, simple source", async (t) => { + const pool = new ResourcePool(); + + // jquery.sap.global-dbg.js: + // /* Some comment */ + // sap.ui.define([], function (){ + // console.log("Put me on a map!"); + // return {}; + // }); + + const originalSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "console", + "log" + ], + "mappings": "AACAA,IAAIC,GAAGC,OAAO,GAAI,WACjBC,QAAQC,IAAI,oBACZ,MAAO", + "file": "jquery.sap.global.js" + }; + pool.addResource({ + name: "jquery.sap.global.js.map", + getPath: () => "jquery.sap.global.js.map", + buffer: async () => JSON.stringify(originalSourceMap) + }); + pool.addResource({ + name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", + buffer: async () => `sap.ui.define([],function(){console.log("Put me on a map!");return{}}); +${SOURCE_MAPPING_URL}=jquery.sap.global.js.map` + }); + + const bundleDefinition = { + name: `Component-preload.js`, + defaultFileTypes: [".js"], + sections: [{ + mode: "preload", + name: "preload-section", + filters: [ + "jquery.sap.global.js" + ] + }] + }; + + const builder = new Builder(pool); + const oResult = await builder.createBundle(bundleDefinition, { + usePredefineCalls: true, + optimize: false + }); + t.deepEqual(oResult.name, "Component-preload.js"); + const expectedContent = `//@ui5-bundle Component-preload.js +sap.ui.predefine("jquery.sap.global", [],function(){console.log("Put me on a map!");return{}}); +${SOURCE_MAPPING_URL}=Component-preload.js.map +`; + t.deepEqual(oResult.content, expectedContent, "Correct bundle content"); + t.deepEqual(oResult.bundleInfo.name, "Component-preload.js", "bundle info name is correct"); + t.deepEqual(oResult.bundleInfo.size, expectedContent.length, "bundle info size is correct"); + t.deepEqual(oResult.bundleInfo.subModules, + [ + "jquery.sap.global.js" + ], "bundle info subModules are correct"); + const indexMap = JSON.parse(oResult.sourceMap); + t.is(indexMap.sections.length, 1, "Bundle index source map contains one section"); + t.deepEqual(indexMap.sections[0].offset, { + line: 1, + column: 0 + }, "Section has correct offset"); + + const expectedSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "console", + "log" + ], + "mappings": "AACAA,IAAIC,GAAGC,+BAAO,GAAI,WACjBC,QAAQC,IAAI,oBACZ,MAAO", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[0].map, expectedSourceMap, "Section contains correct map"); +}); + +test("integration: createBundle using predefine calls with source maps and a single, multi-line source", async (t) => { + const pool = new ResourcePool(); + + // jquery.sap.global-dbg.js: + // /* Some comment */ + // sap. + // ui. + // define( + // [ + // ], function (){ + // console.log("Put me on a map!"); + // return {}; + // }); + + const originalSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "console", + "log" + ], + "mappings": "AACAA,IACAC,GACAC,OACA,GACG,WACFC,QAAQC,IAAI,oBACZ,MAAO", + "file": "jquery.sap.global.js" + }; + pool.addResource({ + name: "jquery.sap.global.js.map", + getPath: () => "jquery.sap.global.js.map", + buffer: async () => JSON.stringify(originalSourceMap) + }); + pool.addResource({ + name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", + buffer: async () => `sap.ui.define([],function(){console.log("Put me on a map!");return{}}); +${SOURCE_MAPPING_URL}=jquery.sap.global.js.map` + }); + + const bundleDefinition = { + name: `Component-preload.js`, + defaultFileTypes: [".js"], + sections: [{ + mode: "preload", + name: "preload-section", + filters: [ + "jquery.sap.global.js" + ] + }] + }; + + const builder = new Builder(pool); + const oResult = await builder.createBundle(bundleDefinition, { + usePredefineCalls: true, + numberOfParts: 1, + decorateBootstrapModule: true, + optimize: false + }); + t.deepEqual(oResult.name, "Component-preload.js"); + const expectedContent = `//@ui5-bundle Component-preload.js +sap.ui.predefine("jquery.sap.global", [],function(){console.log("Put me on a map!");return{}}); +${SOURCE_MAPPING_URL}=Component-preload.js.map +`; + t.deepEqual(oResult.content, expectedContent, "Correct bundle content"); + t.deepEqual(oResult.bundleInfo.name, "Component-preload.js", "bundle info name is correct"); + t.deepEqual(oResult.bundleInfo.size, expectedContent.length, "bundle info size is correct"); + t.deepEqual(oResult.bundleInfo.subModules, + [ + "jquery.sap.global.js" + ], "bundle info subModules are correct"); + const indexMap = JSON.parse(oResult.sourceMap); + t.is(indexMap.sections.length, 1, "Bundle index source map contains one section"); + t.deepEqual(indexMap.sections[0].offset, { + line: 1, + column: 0 + }, "Section has correct offset"); + + const expectedSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "console", + "log" + ], + "mappings": "AACAA,IACAC,GACAC,+BACA,GACG,WACFC,QAAQC,IAAI,oBACZ,MAAO", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[0].map, expectedSourceMap, "Section contains correct map"); +}); + +test("integration: createBundle using predefine calls with source maps and a single source with non-executable code in 1st line", async (t) => { + const pool = new ResourcePool(); + + // jquery.sap.global-dbg.js: + // /*! + // * OpenUI5 + // * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + // * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + // */ + // /*global XMLHttpRequest, localStorage, alert, document */ + // /** + // * @namespace jQuery + // * @public + // */ + // sap.ui.define([ + // // new sap/base/* modules + // "sap/base/util/now", "sap/base/util/Version", "sap/base/assert", "sap/base/Log" + // ], function(now, Version, assert, Log) { + // return now; + // }); + + const originalSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": ";;;;;AAYAA,IAAIC,GAAGC,OAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "file": "jquery.sap.global.js" + }; + pool.addResource({ + name: "jquery.sap.global.js.map", + getPath: () => "jquery.sap.global.js.map", + buffer: async () => JSON.stringify(originalSourceMap) + }); + pool.addResource({ + name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", + buffer: async () => `/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.define(["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=jquery.sap.global.js.map` + }); + + const bundleDefinition = { + name: `Component-preload.js`, + defaultFileTypes: [".js"], + sections: [{ + mode: "preload", + name: "preload-section", + filters: [ + "jquery.sap.global.js" + ] + }] + }; + + const builder = new Builder(pool); + const oResult = await builder.createBundle(bundleDefinition, { + usePredefineCalls: true, + numberOfParts: 1, + decorateBootstrapModule: true, + optimize: false + }); + t.deepEqual(oResult.name, "Component-preload.js"); + const expectedContent = `//@ui5-bundle Component-preload.js +/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.predefine("jquery.sap.global", ["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=Component-preload.js.map +`; + t.deepEqual(oResult.content, expectedContent, "Correct bundle content"); + t.deepEqual(oResult.bundleInfo.name, "Component-preload.js", "bundle info name is correct"); + t.deepEqual(oResult.bundleInfo.size, expectedContent.length, "bundle info size is correct"); + t.deepEqual(oResult.bundleInfo.subModules, + [ + "jquery.sap.global.js" + ], "bundle info subModules are correct"); + const indexMap = JSON.parse(oResult.sourceMap); + t.is(indexMap.sections.length, 1, "Bundle index source map contains one section"); + t.deepEqual(indexMap.sections[0].offset, { + line: 1, + column: 0 + }, "Section has correct offset"); + + const expectedSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": "AAAA;;;;;AAYAA,IAAIC,GAAGC,+BAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[0].map, expectedSourceMap, "Section contains correct map"); +}); + +test("integration: createBundle using predefine calls with source maps and multiple sources", async (t) => { + const pool = new ResourcePool(); + + // jquery.sap.global-dbg.js: + // /*! + // * OpenUI5 + // * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + // * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + // */ + // /*global XMLHttpRequest, localStorage, alert, document */ + // /** + // * @namespace jQuery + // * @public + // */ + // sap.ui.define([ + // // new sap/base/* modules + // "sap/base/util/now", "sap/base/util/Version", "sap/base/assert", "sap/base/Log" + // ], function(now, Version, assert, Log) { + // return now; + // }); + + const originalGlobalSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": ";;;;;AAYAA,IAAIC,GAAGC,OAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "file": "jquery.sap.global.js" + }; + pool.addResource({ + name: "jquery.sap.global.js.map", + getPath: () => "jquery.sap.global.js.map", + buffer: async () => JSON.stringify(originalGlobalSourceMap) + }); + pool.addResource({ + name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", + buffer: async () => `/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.define(["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=jquery.sap.global.js.map` + }); + + // jquery.sap.dom-dbg.js: + // /*! + // * OpenUI5 + // * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + // * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + // */ + // // Provides functionality related to DOM analysis and manipulation which is not provided by jQuery itself. + // sap.ui.define([ + // 'jquery.sap.global', 'sap/ui/dom/containsOrEquals', + // 'sap/ui/core/syncStyleClass', 'sap/ui/dom/getOwnerWindow', 'sap/ui/dom/getScrollbarSize', + // 'sap/ui/dom/denormalizeScrollLeftRTL', 'sap/ui/dom/denormalizeScrollBeginRTL', + // 'sap/ui/dom/units/Rem', 'sap/ui/dom/jquery/Aria', + // 'sap/ui/dom/jquery/Selection', 'sap/ui/dom/jquery/zIndex', 'sap/ui/dom/jquery/parentByAttribute', + // 'sap/ui/dom/jquery/cursorPos', 'sap/ui/dom/jquery/selectText', 'sap/ui/dom/jquery/getSelectedText', + // 'sap/ui/dom/jquery/rect', 'sap/ui/dom/jquery/rectContains', 'sap/ui/dom/jquery/Focusable', + // 'sap/ui/dom/jquery/hasTabIndex', 'sap/ui/dom/jquery/scrollLeftRTL', 'sap/ui/dom/jquery/scrollRightRTL', 'sap/ui/dom/jquery/Selectors' + // ], function(jQuery, domContainsOrEquals, fnSyncStyleClass, domGetOwnerWindow, + // domGetScrollbarSize, domDenormalizeScrollLeftRTL, domDenormalizeScrollBeginRTL, domUnitsRem + // /* + // jqueryAria, + // jquerySelection, + // jqueryzIndex, + // jqueryParentByAttribute, + // jqueryCursorPos, + // jquerySelectText, + // jqueryGetSelectedText, + // jqueryRect, + // jqueryRectContains, + // jqueryFocusable, + // jqueryHasTabIndex, + // jqueryScrollLeftRTL, + // jqueryScrollRightRTL, + // jquerySelectors*/ + // ) { + // "use strict"; + // /** + // * Shortcut for document.getElementById(). + // * + // * @param {string} sId The id of the DOM element to return + // * @param {Window} [oWindow=window] The window (optional) + // * @return {Element} The DOMNode identified by the given sId + // * @public + // * @since 0.9.0 + // * @deprecated since 1.58 use document.getElementById instead + // */ + // jQuery.sap.domById = function domById(sId, oWindow) { + // return sId ? (oWindow || window).document.getElementById(sId) : null; + // }; + // return jQuery; + // }); + + const originalDomSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.dom-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "jQuery", + "domContainsOrEquals", + "fnSyncStyleClass", + "domGetOwnerWindow", + "domGetScrollbarSize", + "domDenormalizeScrollLeftRTL", + "domDenormalizeScrollBeginRTL", + "domUnitsRem", + "domById", + "sId", + "oWindow", + "window", + "document", + "getElementById" + ], + "mappings": ";;;;;AAOAA,IAAIC,GAAGC,OAAO,CACb,oBAAqB,8BACrB,6BAA8B,4BAA6B,8BAC3D,sCAAuC,uCACvC,uBAAwB,yBACxB,8BAA+B,2BAA4B,sCAC3D,8BAA+B,+BAAgC,oCAC/D,yBAA0B,iCAAkC,8BAC5D,gCAAiC,kCAAmC,mCAAoC,+BACtG,SAASC,OAAQC,EAAqBC,EAAkBC,EAC1DC,EAAqBC,EAA6BC,EAA8BC,GAiBhF,aAYAP,OAAOH,IAAIW,QAAU,SAASA,EAAQC,EAAKC,GAC1C,OAAOD,GAAOC,GAAWC,QAAQC,SAASC,eAAeJ,GAAO,MAGjE,OAAOT", + "file": "jquery.sap.dom.js" + }; + pool.addResource({ + name: "jquery.sap.dom.js.map", + getPath: () => "jquery.sap.dom.js.map", + buffer: async () => JSON.stringify(originalDomSourceMap) + }); + pool.addResource({ + name: "jquery.sap.dom.js", + getPath: () => "jquery.sap.dom.js", + buffer: async () => `/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.define(["jquery.sap.global","sap/ui/dom/containsOrEquals","sap/ui/core/syncStyleClass","sap/ui/dom/getOwnerWindow","sap/ui/dom/getScrollbarSize","sap/ui/dom/denormalizeScrollLeftRTL","sap/ui/dom/denormalizeScrollBeginRTL","sap/ui/dom/units/Rem","sap/ui/dom/jquery/Aria","sap/ui/dom/jquery/Selection","sap/ui/dom/jquery/zIndex","sap/ui/dom/jquery/parentByAttribute","sap/ui/dom/jquery/cursorPos","sap/ui/dom/jquery/selectText","sap/ui/dom/jquery/getSelectedText","sap/ui/dom/jquery/rect","sap/ui/dom/jquery/rectContains","sap/ui/dom/jquery/Focusable","sap/ui/dom/jquery/hasTabIndex","sap/ui/dom/jquery/scrollLeftRTL","sap/ui/dom/jquery/scrollRightRTL","sap/ui/dom/jquery/Selectors"],function(jQuery,e,u,o,s,i,r,a){"use strict";jQuery.sap.domById=function e(u,o){return u?(o||window).document.getElementById(u):null};return jQuery}); +${SOURCE_MAPPING_URL}=jquery.sap.dom.js.map` + }); + + const bundleDefinition = { + name: `Component-preload.js`, + defaultFileTypes: [".js"], + sections: [{ + mode: "preload", + name: "preload-section", + filters: [ + "jquery.sap.global.js", + "jquery.sap.dom.js" + ] + }] + }; + + const builder = new Builder(pool); + const oResult = await builder.createBundle(bundleDefinition, { + usePredefineCalls: true, + numberOfParts: 1, + decorateBootstrapModule: true, + optimize: false + }); + t.deepEqual(oResult.name, "Component-preload.js"); + const expectedContent = `//@ui5-bundle Component-preload.js +/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.predefine("jquery.sap.dom", ["jquery.sap.global","sap/ui/dom/containsOrEquals","sap/ui/core/syncStyleClass","sap/ui/dom/getOwnerWindow","sap/ui/dom/getScrollbarSize","sap/ui/dom/denormalizeScrollLeftRTL","sap/ui/dom/denormalizeScrollBeginRTL","sap/ui/dom/units/Rem","sap/ui/dom/jquery/Aria","sap/ui/dom/jquery/Selection","sap/ui/dom/jquery/zIndex","sap/ui/dom/jquery/parentByAttribute","sap/ui/dom/jquery/cursorPos","sap/ui/dom/jquery/selectText","sap/ui/dom/jquery/getSelectedText","sap/ui/dom/jquery/rect","sap/ui/dom/jquery/rectContains","sap/ui/dom/jquery/Focusable","sap/ui/dom/jquery/hasTabIndex","sap/ui/dom/jquery/scrollLeftRTL","sap/ui/dom/jquery/scrollRightRTL","sap/ui/dom/jquery/Selectors"],function(jQuery,e,u,o,s,i,r,a){"use strict";jQuery.sap.domById=function e(u,o){return u?(o||window).document.getElementById(u):null};return jQuery}); +/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.predefine("jquery.sap.global", ["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=Component-preload.js.map +`; + t.deepEqual(oResult.content, expectedContent, "Correct bundle content"); + t.deepEqual(oResult.bundleInfo.name, "Component-preload.js", "bundle info name is correct"); + t.deepEqual(oResult.bundleInfo.size, expectedContent.length, "bundle info size is correct"); + t.deepEqual(oResult.bundleInfo.subModules, + [ + "jquery.sap.dom.js", + "jquery.sap.global.js" + ], "bundle info subModules are correct"); + const indexMap = JSON.parse(oResult.sourceMap); + t.is(indexMap.sections.length, 2, "Bundle index source map contains two sections"); + t.deepEqual(indexMap.sections[0].offset, { + line: 1, + column: 0 + }, "Section one has correct offset"); + + const expectedSourceMap1 = { + "version": 3, + "sources": + [ + "jquery.sap.dom-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "jQuery", + "domContainsOrEquals", + "fnSyncStyleClass", + "domGetOwnerWindow", + "domGetScrollbarSize", + "domDenormalizeScrollLeftRTL", + "domDenormalizeScrollBeginRTL", + "domUnitsRem", + "domById", + "sId", + "oWindow", + "window", + "document", + "getElementById" + ], + "mappings": "AAAA;;;;;AAOAA,IAAIC,GAAGC,4BAAO,CACb,oBAAqB,8BACrB,6BAA8B,4BAA6B,8BAC3D,sCAAuC,uCACvC,uBAAwB,yBACxB,8BAA+B,2BAA4B,sCAC3D,8BAA+B,+BAAgC,oCAC/D,yBAA0B,iCAAkC,8BAC5D,gCAAiC,kCAAmC,mCAAoC,+BACtG,SAASC,OAAQC,EAAqBC,EAAkBC,EAC1DC,EAAqBC,EAA6BC,EAA8BC,GAiBhF,aAYAP,OAAOH,IAAIW,QAAU,SAASA,EAAQC,EAAKC,GAC1C,OAAOD,GAAOC,GAAWC,QAAQC,SAASC,eAAeJ,GAAO,MAGjE,OAAOT", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[0].map, expectedSourceMap1, "Section one contains correct map"); + t.deepEqual(indexMap.sections[1].offset, { + line: 7, + column: 0 + }, "Section two has correct offset"); + + const expectedSourceMap2 = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": "AAAA;;;;;AAYAA,IAAIC,GAAGC,+BAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[1].map, expectedSourceMap2, "Section two contains correct map"); +}); + +test("integration: createBundle using predefine calls with source maps and multiple sources 2", async (t) => { + const pool = new ResourcePool(); + + // jquery.sap.global-dbg.js: + // /*! + // * OpenUI5 + // * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + // * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + // */ + // /*global XMLHttpRequest, localStorage, alert, document */ + // /** + // * @namespace jQuery + // * @public + // */ + // sap.ui.define([ + // // new sap/base/* modules + // "sap/base/util/now", "sap/base/util/Version", "sap/base/assert", "sap/base/Log" + // ], function(now, Version, assert, Log) { + // return now; + // }); + + const originalGlobalSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": ";;;;;AAYAA,IAAIC,GAAGC,OAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "file": "jquery.sap.global.js" + }; + pool.addResource({ + name: "jquery.sap.global.js.map", + getPath: () => "jquery.sap.global.js.map", + buffer: async () => JSON.stringify(originalGlobalSourceMap) + }); + pool.addResource({ + name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", + buffer: async () => `/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.define(["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=jquery.sap.global.js.map` + }); + + // No source map for "jquery.sap.xom.js" => Transitive source map will be created + pool.addResource({ + name: "jquery.sap.xom.js", + getPath: () => "jquery.sap.xom.js", + buffer: async () => `/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.define(function() { + console.log("Test"); +}); +` + }); + + const bundleDefinition = { + name: `Component-preload.js`, + defaultFileTypes: [".js"], + sections: [{ + mode: "preload", + name: "preload-section", + filters: [ + "jquery.sap.global.js", + "jquery.sap.xom.js" + ] + }] + }; + + const builder = new Builder(pool); + const oResult = await builder.createBundle(bundleDefinition, { + usePredefineCalls: true, + numberOfParts: 1, + decorateBootstrapModule: true, + optimize: false + }); + t.deepEqual(oResult.name, "Component-preload.js"); + const expectedContent = `//@ui5-bundle Component-preload.js +/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.predefine("jquery.sap.global", ["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.predefine("jquery.sap.xom", function() { + console.log("Test"); +}); +${SOURCE_MAPPING_URL}=Component-preload.js.map +`; + t.deepEqual(oResult.content, expectedContent, "Correct bundle content"); + t.deepEqual(oResult.bundleInfo.name, "Component-preload.js", "bundle info name is correct"); + t.deepEqual(oResult.bundleInfo.size, expectedContent.length, "bundle info size is correct"); + t.deepEqual(oResult.bundleInfo.subModules, + [ + "jquery.sap.global.js", + "jquery.sap.xom.js", + ], "bundle info subModules are correct"); + const indexMap = JSON.parse(oResult.sourceMap); + t.is(indexMap.sections.length, 2, "Bundle index source map contains two sections"); + t.deepEqual(indexMap.sections[0].offset, { + line: 1, + column: 0 + }, "Section one has correct offset"); + + const expectedSourceMap1 = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": "AAAA;;;;;AAYAA,IAAIC,GAAGC,+BAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[0].map, expectedSourceMap1, "Section one contains correct map"); + t.deepEqual(indexMap.sections[1].offset, { + line: 7, + column: 0 + }, "Section two has correct offset"); + + const expectedSourceMap2 = { // Transitive source map + "version": 3, + "sources": + [ + "jquery.sap.xom.js" + ], + "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[1].map, expectedSourceMap2, "Section two contains correct map"); +}); + +test("integration: createBundle using predefine calls with inline source maps and a single source", async (t) => { + const pool = new ResourcePool(); + + // jquery.sap.global-dbg.js: + // /*! + // * OpenUI5 + // * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + // * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + // */ + // /*global XMLHttpRequest, localStorage, alert, document */ + // /** + // * @namespace jQuery + // * @public + // */ + // sap.ui.define([ + // // new sap/base/* modules + // "sap/base/util/now", "sap/base/util/Version", "sap/base/assert", "sap/base/Log" + // ], function(now, Version, assert, Log) { + // return now; + // }); + + // Source map should be identical to "single source" test above + pool.addResource({ + name: "jquery.sap.global.js", + getPath: () => "jquery.sap.global.js", + buffer: async () => `/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.define(["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxdWVyeS5zYXAuZ2xvYmFsLWRiZy5qcyJdLCJuYW1lcyI6WyJzYXAiLCJ1aSIsImRlZmluZSIsIm5vdyIsIlZlcnNpb24iLCJhc3NlcnQiLCJMb2ciXSwibWFwcGluZ3MiOiI7Ozs7O0FBWUFBLElBQUlDLEdBQUdDLE9BQU8sQ0FFYixvQkFBcUIsd0JBQXlCLGtCQUFtQixnQkFDL0QsU0FBU0MsRUFBS0MsRUFBU0MsRUFBUUMsR0FDakMsT0FBT0giLCJmaWxlIjoianF1ZXJ5LnNhcC5nbG9iYWwuanMifQ==` + }); + + const bundleDefinition = { + name: `Component-preload.js`, + defaultFileTypes: [".js"], + sections: [{ + mode: "preload", + name: "preload-section", + filters: [ + "jquery.sap.global.js" + ] + }] + }; + + const builder = new Builder(pool); + const oResult = await builder.createBundle(bundleDefinition, { + usePredefineCalls: true, + numberOfParts: 1, + decorateBootstrapModule: true, + optimize: false + }); + t.deepEqual(oResult.name, "Component-preload.js"); + const expectedContent = `//@ui5-bundle Component-preload.js +/*! + * OpenUI5 + * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company. + * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. + */ +sap.ui.predefine("jquery.sap.global", ["sap/base/util/now","sap/base/util/Version","sap/base/assert","sap/base/Log"],function(s,a,e,i){return s}); +${SOURCE_MAPPING_URL}=Component-preload.js.map +`; + t.deepEqual(oResult.content, expectedContent, "Correct bundle content"); + t.deepEqual(oResult.bundleInfo.name, "Component-preload.js", "bundle info name is correct"); + t.deepEqual(oResult.bundleInfo.size, expectedContent.length, "bundle info size is correct"); + t.deepEqual(oResult.bundleInfo.subModules, + [ + "jquery.sap.global.js" + ], "bundle info subModules are correct"); + const indexMap = JSON.parse(oResult.sourceMap); + t.is(indexMap.sections.length, 1, "Bundle index source map contains one section"); + t.deepEqual(indexMap.sections[0].offset, { + line: 1, + column: 0 + }, "Section has correct offset"); + + const expectedSourceMap = { + "version": 3, + "sources": + [ + "jquery.sap.global-dbg.js" + ], + "names": + [ + "sap", + "ui", + "define", + "now", + "Version", + "assert", + "Log" + ], + "mappings": "AAAA;;;;;AAYAA,IAAIC,GAAGC,+BAAO,CAEb,oBAAqB,wBAAyB,kBAAmB,gBAC/D,SAASC,EAAKC,EAASC,EAAQC,GACjC,OAAOH", + "sourceRoot": "" + }; + t.deepEqual(indexMap.sections[0].map, expectedSourceMap, "Section contains correct map"); +}); + +test("rewriteDefine (without moduleSourceMap)", async (t) => { + const {rewriteDefine} = Builder.__localFunctions__; + + const {moduleContent, moduleSourceMap} = await rewriteDefine({ + moduleName: "my/test/module.js", + moduleContent: "sap.ui.define([],(()=>1));", + moduleSourceMap: undefined + }); + + t.is(moduleContent, `sap.ui.predefine("my/test/module", [],(()=>1));`); + t.is(moduleSourceMap, undefined); +}); + +test("rewriteDefine (with moduleSourceMap)", async (t) => { + const {rewriteDefine} = Builder.__localFunctions__; + const {encode: encodeMappings, decode: decodeMappings} = require("sourcemap-codec"); + + const inputMappings = [ + [ + [ + 0, 0, 0, 0, 0 + ], + [ + 4, 0, 0, 4, 1 + ], + [ + 7, 0, 0, 7, 2 + ], + [ + 14, 0, 0, 14 + ], + [ + 18, 0, 0, 18 + ], + [ + 22, 0, 1, 8 + ] + ] + ]; + + const {moduleContent, moduleSourceMap} = await rewriteDefine({ + moduleName: "my/test/module.js", + moduleContent: "sap.ui.define([],(()=>1));", + moduleSourceMap: { + "version": 3, + "file": "module.js", + "sources": ["my/test/module-dbg.js"], + "names": ["sap", "ui", "define"], + "mappings": encodeMappings(inputMappings) + } + }); + + const expectedMappings = JSON.parse(JSON.stringify(inputMappings)); + const expectedColumnDiff = `"my/test/module", `.length + "pre".length; + expectedMappings[0][3][0] += expectedColumnDiff; + expectedMappings[0][4][0] += expectedColumnDiff; + expectedMappings[0][5][0] += expectedColumnDiff; + + t.is(moduleContent, `sap.ui.predefine("my/test/module", [],(()=>1));`); + t.deepEqual(decodeMappings(moduleSourceMap.mappings), expectedMappings); + t.deepEqual(moduleSourceMap, { + "version": 3, + "sources": ["my/test/module-dbg.js"], + "names": ["sap", "ui", "define"], + "mappings": encodeMappings(expectedMappings) + }); +}); + +test("rewriteDefine (with empty moduleSourceMap)", async (t) => { + const {rewriteDefine} = Builder.__localFunctions__; + const {encode: encodeMappings, decode: decodeMappings} = require("sourcemap-codec"); + + const inputMappings = [ + [ + [ + 0, 0, 0, 0 + ] + ] + ]; + + const {moduleContent, moduleSourceMap} = await rewriteDefine({ + moduleName: "my/test/module.js", + moduleContent: `sap +.ui.define([], () => { + return 1; +});`, + moduleSourceMap: { + "version": 3, + "sources": ["my/test/module.js"], + "mappings": encodeMappings(inputMappings) + } + }); + + const expectedMappings = JSON.parse(JSON.stringify(inputMappings)); + + t.is(moduleContent, `sap +.ui.predefine("my/test/module", [], () => { + return 1; +});`); + t.deepEqual(decodeMappings(moduleSourceMap.mappings), expectedMappings); + t.deepEqual(moduleSourceMap, { + "version": 3, + "sources": ["my/test/module.js"], + "mappings": encodeMappings(expectedMappings) + }); +}); + +test("getSourceMapForModule: Source map resource named after module resource (no sourceMappingURL)", async (t) => { + const originalSourceMap = { + "version": 3, + "sources": + [ + "module-dbg.js" + ], + "names": + [ + ], + "mappings": "XXXX", + "file": "module.js" + }; + const pool = new ResourcePool(); + pool.addResource({ + name: "my/test/module.js.map", + getPath: () => "my/test/module.js.map", + string: function() { + return this.buffer(); + }, + buffer: async () => JSON.stringify(originalSourceMap) + }); + + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, originalSourceMap, "Correct source map retrieved via relative URL"); +}); +test("getSourceMapForModule: No source map available for debug variant", async (t) => { + const originalSourceMap = { + "version": 3, + "sources": + [ + "module-dbg.js" + ], + "names": + [ + ], + "mappings": "XXXX", + "file": "module.js" + }; + const pool = new ResourcePool(); + pool.addResource({ + name: "my/test/module.js.map", + getPath: () => "my/test/module.js.map", + string: function() { + return this.buffer(); + }, + buffer: async () => JSON.stringify(originalSourceMap) + }); + + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module-dbg.js", + moduleContent: `// Some content +` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, { + mappings: "AAAA;AACA", + sources: [ + "module-dbg.js", + ], + version: 3, + }, "Expected transitive source map has been generated"); +}); + +test("getSourceMapForModule: Relative URL", async (t) => { + const originalSourceMap = { + "version": 3, + "sources": + [ + "module-dbg.js" + ], + "names": + [ + ], + "mappings": "XXXX", + "file": "module.js" + }; + const pool = new ResourcePool(); + pool.addResource({ + name: "my/test/module.js.map", + getPath: () => "my/test/module.js.map", + string: function() { + return this.buffer(); + }, + buffer: async () => JSON.stringify(originalSourceMap) + }); + + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +${SOURCE_MAPPING_URL}=module.js.map` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, originalSourceMap, "Correct source map retrieved via relative URL"); +}); + +test("getSourceMapForModule: Relative URL to resource that cannot be found", async (t) => { + const pool = new ResourcePool(); + + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +${SOURCE_MAPPING_URL}=module.js.map` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, { + mappings: "AAAA;AACA", + sources: [ + "module.js", + ], + version: 3, + }, "Expected transitive source map has been generated"); +}); + +test("getSourceMapForModule: Full URL (not supported)", async (t) => { + const pool = new ResourcePool(); + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +${SOURCE_MAPPING_URL}=https://ui5.sap.com/resources/my/test/module.js.map` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, { + mappings: "AAAA;AACA", + sources: [ + "module.js", + ], + version: 3, + }, "Expected transitive source map has been generated"); +}); + +test("getSourceMapForModule: Absolute URL (not supported)", async (t) => { + const pool = new ResourcePool(); + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +${SOURCE_MAPPING_URL}=/resources/my/test/module.js.map` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, { + mappings: "AAAA;AACA", + sources: [ + "module.js", + ], + version: 3, + }, "Expected transitive source map has been generated"); +}); + +test("getSourceMapForModule: Data URI", async (t) => { + const pool = new ResourcePool(); + const builder = new Builder(pool); + const originalSourceMap = { + "version": 3, + "sources": + [ + "module-dbg.js" + ], + "names": + [ + ], + "mappings": "XXXX", + "file": "module.js" + }; + const encodedSourceMap = Buffer.from(JSON.stringify(originalSourceMap)).toString("base64"); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +${SOURCE_MAPPING_URL}=data:application/json;charset=utf-8;base64,${encodedSourceMap}` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, originalSourceMap, "Encoded source map has been parsed correctly"); +}); + +test("getSourceMapForModule: Data URI with incorrect encoding", async (t) => { + const pool = new ResourcePool(); + const builder = new Builder(pool); + const {moduleContent, moduleSourceMap} = await builder.getSourceMapForModule({ + moduleName: "my/test/module", + resourcePath: "/resources/my/test/module.js", + moduleContent: `// Some content +${SOURCE_MAPPING_URL}=data:application/pony;charset=utf-8;base64,AAAA` + }); + + t.is(moduleContent, "// Some content\n", "Source map URL has been removed from module content"); + t.deepEqual(moduleSourceMap, { + mappings: "AAAA;AACA", + sources: [ + "module.js", + ], + version: 3, + }, "Expected transitive source map has been generated"); +}); + +test("createTransientSourceMap: includeContent=false", async (t) => { + const {createTransientSourceMap} = Builder.__localFunctions__; + + const res = createTransientSourceMap({ + moduleName: "my/test/module.js", + moduleContent: `Some content +With +Multiple +Lines`, + includeContent: false + }); + t.deepEqual(res, { + "version": 3, + "sources": ["my/test/module.js"], + "mappings": "AAAA;AACA;AACA;AACA" + }, "Expected source map has been created"); +}); + +test("createTransientSourceMap: includeContent=true", async (t) => { + const {createTransientSourceMap} = Builder.__localFunctions__; + + const moduleContent = `Some content +With +Multiple +Lines`; + const res = createTransientSourceMap({ + moduleName: "my/test/module.js", + moduleContent, + includeContent: true + }); + t.deepEqual(res, { + version: 3, + sources: ["my/test/module.js"], + mappings: "AAAA;AACA;AACA;AACA", + sourcesContent: [moduleContent] + }, "Expected source map has been created"); +}); diff --git a/test/lib/processors/bundlers/moduleBundler.js b/test/lib/processors/bundlers/moduleBundler.js index a357e2eae..174a95bec 100644 --- a/test/lib/processors/bundlers/moduleBundler.js +++ b/test/lib/processors/bundlers/moduleBundler.js @@ -70,8 +70,8 @@ test.serial("Builder returns single bundle", async (t) => { } }); - t.deepEqual(outputResources, [expectedOutputResource]); - t.is(outputResources[0], expectedOutputResource); + t.deepEqual(outputResources, [{bundle: expectedOutputResource}]); + t.is(outputResources[0].bundle, expectedOutputResource); t.is(LocatorResourcePool.callCount, 1, "LocatorResourcePool should be created once"); t.true(LocatorResourcePool.calledWithNew()); @@ -87,8 +87,9 @@ test.serial("Builder returns single bundle", async (t) => { t.is(BundleBuilder.getCall(0).args[0], pool, "LocatorResourcePool should be called with pool"); t.is(pool.prepare.callCount, 1, "pool.prepare should be called once"); - t.is(pool.prepare.getCall(0).args.length, 1); + t.is(pool.prepare.getCall(0).args.length, 2); t.is(pool.prepare.getCall(0).args[0], resources, "pool.prepare should be called with resources"); + t.is(pool.prepare.getCall(0).args[1], undefined, "pool.prepare should be called without moduleNameMapping"); t.is(builder.createBundle.callCount, 1, "builder.createBundle should be called once"); t.is(builder.createBundle.getCall(0).args.length, 2); @@ -155,16 +156,20 @@ test.serial("Builder returns multiple bundles", async (t) => { const expectedOutputResources = [ { - "output": "resource 1" + bundle: { + "output": "resource 1" + }, }, undefined, { - "output": "resource 2" + bundle: { + "output": "resource 2" + } }, undefined ]; - Resource.onFirstCall().returns(expectedOutputResources[0]); - Resource.onSecondCall().returns(expectedOutputResources[2]); + Resource.onFirstCall().returns(expectedOutputResources[0].bundle); + Resource.onSecondCall().returns(expectedOutputResources[2].bundle); const outputResources = await processor({ resources, @@ -175,9 +180,9 @@ test.serial("Builder returns multiple bundles", async (t) => { }); t.deepEqual(outputResources, expectedOutputResources); - t.is(outputResources[0], expectedOutputResources[0]); + t.is(outputResources[0].bundle, expectedOutputResources[0].bundle); t.is(outputResources[1], expectedOutputResources[1]); - t.is(outputResources[2], expectedOutputResources[2]); + t.is(outputResources[2].bundle, expectedOutputResources[2].bundle); t.is(LocatorResourcePool.callCount, 1, "LocatorResourcePool should be created once"); t.true(LocatorResourcePool.calledWithNew()); @@ -193,8 +198,9 @@ test.serial("Builder returns multiple bundles", async (t) => { t.is(BundleBuilder.getCall(0).args[0], pool, "LocatorResourcePool should be called with pool"); t.is(pool.prepare.callCount, 1, "pool.prepare should be called once"); - t.is(pool.prepare.getCall(0).args.length, 1); + t.is(pool.prepare.getCall(0).args.length, 2); t.is(pool.prepare.getCall(0).args[0], resources, "pool.prepare should be called with resources"); + t.is(pool.prepare.getCall(0).args[1], undefined, "pool.prepare should be called without moduleNameMapping"); t.is(builder.createBundle.callCount, 1, "builder.createBundle should be called once"); t.is(builder.createBundle.getCall(0).args.length, 2); @@ -263,8 +269,8 @@ test.serial("bundleOptions default (no options passed)", async (t) => { } }); - t.deepEqual(outputResources, [expectedOutputResource]); - t.is(outputResources[0], expectedOutputResource); + t.deepEqual(outputResources, [{bundle: expectedOutputResource}]); + t.is(outputResources[0].bundle, expectedOutputResource); t.is(LocatorResourcePool.callCount, 1, "LocatorResourcePool should be created once"); t.true(LocatorResourcePool.calledWithNew()); @@ -280,8 +286,9 @@ test.serial("bundleOptions default (no options passed)", async (t) => { t.is(BundleBuilder.getCall(0).args[0], pool, "LocatorResourcePool should be called with pool"); t.is(pool.prepare.callCount, 1, "pool.prepare should be called once"); - t.is(pool.prepare.getCall(0).args.length, 1); + t.is(pool.prepare.getCall(0).args.length, 2); t.is(pool.prepare.getCall(0).args[0], resources, "pool.prepare should be called with resources"); + t.is(pool.prepare.getCall(0).args[1], undefined, "pool.prepare should be called without moduleNameMapping"); t.is(builder.createBundle.callCount, 1, "builder.createBundle should be called once"); t.is(builder.createBundle.getCall(0).args.length, 2); @@ -464,8 +471,8 @@ test.serial("Passes ignoreMissingModules bundleOption to LocatorResourcePool", a } }); - t.deepEqual(outputResources, [expectedOutputResource]); - t.is(outputResources[0], expectedOutputResource); + t.deepEqual(outputResources, [{bundle: expectedOutputResource}]); + t.is(outputResources[0].bundle, expectedOutputResource); t.is(LocatorResourcePool.callCount, 1, "LocatorResourcePool should be created once"); t.true(LocatorResourcePool.calledWithNew()); @@ -481,8 +488,9 @@ test.serial("Passes ignoreMissingModules bundleOption to LocatorResourcePool", a t.is(BundleBuilder.getCall(0).args[0], pool, "LocatorResourcePool should be called with pool"); t.is(pool.prepare.callCount, 1, "pool.prepare should be called once"); - t.is(pool.prepare.getCall(0).args.length, 1); + t.is(pool.prepare.getCall(0).args.length, 2); t.is(pool.prepare.getCall(0).args[0], resources, "pool.prepare should be called with resources"); + t.is(pool.prepare.getCall(0).args[1], undefined, "pool.prepare should be called without moduleNameMapping"); t.is(builder.createBundle.callCount, 1, "builder.createBundle should be called once"); t.is(builder.createBundle.getCall(0).args.length, 2); diff --git a/test/lib/tasks/bundlers/generateComponentPreload.js b/test/lib/tasks/bundlers/generateComponentPreload.js index fc6546139..4cd92f9a9 100644 --- a/test/lib/tasks/bundlers/generateComponentPreload.js +++ b/test/lib/tasks/bundlers/generateComponentPreload.js @@ -26,7 +26,7 @@ test.beforeEach((t) => { ReaderCollectionPrioritized: t.context.ReaderCollectionPrioritizedStub }); - t.context.moduleBundlerStub = sinon.stub().resolves([{"fake": "resource"}]); + t.context.moduleBundlerStub = sinon.stub().resolves([]); mock("../../../../lib/processors/bundlers/moduleBundler", t.context.moduleBundlerStub); t.context.generateComponentPreload = mock.reRequire("../../../../lib/tasks/bundlers/generateComponentPreload"); @@ -48,6 +48,14 @@ test.serial("generateComponentPreload - one namespace", async (t) => { ]; comboByGlob.resolves(resources); + moduleBundlerStub.resolves([ + { + name: "my/app/Component-preload.js", + bundle: {"fake": "bundle"}, + sourceMap: {"fake": "sourceMap"} + } + ]); + await generateComponentPreload({ workspace, dependencies, @@ -99,7 +107,7 @@ test.serial("generateComponentPreload - one namespace", async (t) => { t.is(comboByGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library}"], + t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); t.is(ReaderCollectionPrioritizedStub.callCount, 1, @@ -108,11 +116,15 @@ test.serial("generateComponentPreload - one namespace", async (t) => { "ReaderCollectionPrioritized should have been called with 'new'"); const bundleResources = await moduleBundlerStub.getCall(0).returnValue; - t.is(workspace.write.callCount, 1, - "workspace.write should have been called once"); - t.deepEqual(workspace.write.getCall(0).args, [bundleResources[0]], + t.is(workspace.write.callCount, 2, + "workspace.write should have been called twice"); + t.deepEqual(workspace.write.getCall(0).args, [bundleResources[0].bundle], "workspace.write should have been called with expected args"); - t.is(workspace.write.getCall(0).args[0], bundleResources[0], + t.is(workspace.write.getCall(0).args[0], bundleResources[0].bundle, + "workspace.write should have been called with exact resource returned by moduleBundler"); + t.deepEqual(workspace.write.getCall(1).args, [bundleResources[0].sourceMap], + "workspace.write should have been called with expected args"); + t.is(workspace.write.getCall(1).args[0], bundleResources[0].sourceMap, "workspace.write should have been called with exact resource returned by moduleBundler"); }); @@ -127,6 +139,14 @@ test.serial("generateComponentPreload - one namespace - excludes", async (t) => ]; comboByGlob.resolves(resources); + moduleBundlerStub.resolves([ + { + name: "my/app/Component-preload.js", + bundle: {"fake": "bundle"}, + sourceMap: {"fake": "sourceMap"} + } + ]); + await generateComponentPreload({ workspace, dependencies, @@ -184,7 +204,7 @@ test.serial("generateComponentPreload - one namespace - excludes", async (t) => t.is(comboByGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library}"], + t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); t.is(ReaderCollectionPrioritizedStub.callCount, 1, @@ -193,11 +213,15 @@ test.serial("generateComponentPreload - one namespace - excludes", async (t) => "ReaderCollectionPrioritized should have been called with 'new'"); const bundleResources = await moduleBundlerStub.getCall(0).returnValue; - t.is(workspace.write.callCount, 1, - "workspace.write should have been called once"); - t.deepEqual(workspace.write.getCall(0).args, [bundleResources[0]], + t.is(workspace.write.callCount, 2, + "workspace.write should have been called twice"); + t.deepEqual(workspace.write.getCall(0).args, [bundleResources[0].bundle], + "workspace.write should have been called with expected args"); + t.is(workspace.write.getCall(0).args[0], bundleResources[0].bundle, + "workspace.write should have been called with exact resource returned by moduleBundler"); + t.deepEqual(workspace.write.getCall(1).args, [bundleResources[0].sourceMap], "workspace.write should have been called with expected args"); - t.is(workspace.write.getCall(0).args[0], bundleResources[0], + t.is(workspace.write.getCall(1).args[0], bundleResources[0].sourceMap, "workspace.write should have been called with exact resource returned by moduleBundler"); }); @@ -212,6 +236,14 @@ test.serial("generateComponentPreload - one namespace - excludes w/o namespace", ]; comboByGlob.resolves(resources); + moduleBundlerStub.resolves([ + { + name: "my/app/Component-preload.js", + bundle: {"fake": "bundle"}, + sourceMap: {"fake": "sourceMap"} + } + ]); + await generateComponentPreload({ workspace, dependencies, @@ -268,7 +300,7 @@ test.serial("generateComponentPreload - one namespace - excludes w/o namespace", t.is(comboByGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library}"], + t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); t.is(ReaderCollectionPrioritizedStub.callCount, 1, @@ -277,11 +309,15 @@ test.serial("generateComponentPreload - one namespace - excludes w/o namespace", "ReaderCollectionPrioritized should have been called with 'new'"); const bundleResources = await moduleBundlerStub.getCall(0).returnValue; - t.is(workspace.write.callCount, 1, - "workspace.write should have been called once"); - t.deepEqual(workspace.write.getCall(0).args, [bundleResources[0]], + t.is(workspace.write.callCount, 2, + "workspace.write should have been called twice"); + t.deepEqual(workspace.write.getCall(0).args, [bundleResources[0].bundle], + "workspace.write should have been called with expected args"); + t.is(workspace.write.getCall(0).args[0], bundleResources[0].bundle, + "workspace.write should have been called with exact resource returned by moduleBundler"); + t.deepEqual(workspace.write.getCall(1).args, [bundleResources[0].sourceMap], "workspace.write should have been called with expected args"); - t.is(workspace.write.getCall(0).args[0], bundleResources[0], + t.is(workspace.write.getCall(1).args[0], bundleResources[0].sourceMap, "workspace.write should have been called with exact resource returned by moduleBundler"); }); @@ -296,6 +332,21 @@ test.serial("generateComponentPreload - multiple namespaces - excludes", async ( ]; comboByGlob.resolves(resources); + moduleBundlerStub.onFirstCall().resolves([ + { + name: "my/app1/Component-preload.js", + bundle: {"fake": "bundle1"}, + sourceMap: {"fake": "sourceMap1"} + } + ]); + moduleBundlerStub.onSecondCall().resolves([ + { + name: "my/app2/Component-preload.js", + bundle: {"fake": "bundle2"}, + sourceMap: {"fake": "sourceMap2"} + } + ]); + await generateComponentPreload({ workspace, dependencies, @@ -400,7 +451,7 @@ test.serial("generateComponentPreload - multiple namespaces - excludes", async ( t.is(comboByGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library}"], + t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); t.is(ReaderCollectionPrioritizedStub.callCount, 1, @@ -408,17 +459,28 @@ test.serial("generateComponentPreload - multiple namespaces - excludes", async ( t.true(ReaderCollectionPrioritizedStub.calledWithNew(), "ReaderCollectionPrioritized should have been called with 'new'"); - const bundleResources1 = await moduleBundlerStub.getCall(0).returnValue; - const bundleResources2 = await moduleBundlerStub.getCall(1).returnValue; - t.is(workspace.write.callCount, 2, - "workspace.write should have been called twice"); - t.deepEqual(workspace.write.getCall(0).args, [bundleResources1[0]], + const bundleObj1 = await moduleBundlerStub.getCall(0).returnValue; + const bundleObj2 = await moduleBundlerStub.getCall(1).returnValue; + + t.is(workspace.write.callCount, 4, + "workspace.write should have been called 4 times (2x .js, 2x .js.map)"); + + t.deepEqual(workspace.write.getCall(0).args, [bundleObj1[0].bundle], + "workspace.write should have been called with expected args"); + t.is(workspace.write.getCall(0).args[0], bundleObj1[0].bundle, + "workspace.write should have been called with exact resource returned by moduleBundler"); + t.deepEqual(workspace.write.getCall(1).args, [bundleObj1[0].sourceMap], + "workspace.write should have been called with expected args"); + t.is(workspace.write.getCall(1).args[0], bundleObj1[0].sourceMap, + "workspace.write should have been called with exact resource returned by moduleBundler"); + + t.deepEqual(workspace.write.getCall(2).args, [bundleObj2[0].bundle], "workspace.write should have been called with expected args"); - t.is(workspace.write.getCall(0).args[0], bundleResources1[0], + t.is(workspace.write.getCall(2).args[0], bundleObj2[0].bundle, "workspace.write should have been called with exact resource returned by moduleBundler"); - t.deepEqual(workspace.write.getCall(1).args, [bundleResources2[0]], + t.deepEqual(workspace.write.getCall(3).args, [bundleObj2[0].sourceMap], "workspace.write should have been called with expected args"); - t.is(workspace.write.getCall(1).args[0], bundleResources2[0], + t.is(workspace.write.getCall(3).args[0], bundleObj2[0].sourceMap, "workspace.write should have been called with exact resource returned by moduleBundler"); }); diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.integration.js b/test/lib/tasks/bundlers/generateLibraryPreload.integration.js index e6d57d741..f45e38a64 100644 --- a/test/lib/tasks/bundlers/generateLibraryPreload.integration.js +++ b/test/lib/tasks/bundlers/generateLibraryPreload.integration.js @@ -46,7 +46,7 @@ test("integration: build library.d with library preload", async (t) => { assert.directoryDeepEqual(destPath, expectedPath); // Check for all file contents - t.deepEqual(expectedFiles.length, 4, "4 files are expected"); + t.deepEqual(expectedFiles.length, 5, "5 files are expected"); expectedFiles.forEach((expectedFile) => { const relativeFile = path.relative(expectedPath, expectedFile); const destFile = path.join(destPath, relativeFile); @@ -99,7 +99,6 @@ test("integration: build sap.ui.core with library preload", async (t) => { assert.directoryDeepEqual(destPath, expectedPath); // Check for all file contents - t.deepEqual(expectedFiles.length, 17, "17 files are expected"); expectedFiles.forEach((expectedFile) => { const relativeFile = path.relative(expectedPath, expectedFile); const destFile = path.join(destPath, relativeFile); @@ -162,7 +161,8 @@ test("integration: generateLibraryPreload", async (t) => { const writtenResources = await writer.byGlob(["**/**"]); t.deepEqual(writtenResources.map((r) => r.getPath()).sort(), [ - "/resources/my/test/lib/library-preload.js" + "/resources/my/test/lib/library-preload.js", + "/resources/my/test/lib/library-preload.js.map" ], "Expected preload files should be created"); const libraryPreload = await writer.byPath("/resources/my/test/lib/library-preload.js"); @@ -172,6 +172,12 @@ test("integration: generateLibraryPreload", async (t) => { "library-preload should be a bundle"); t.regex(libraryPreloadContent, new RegExp("my/test/lib/library"), "library-preload should include library.js module"); + + const libraryPreloadSourceMap = await writer.byPath("/resources/my/test/lib/library-preload.js.map"); + const libraryPreloadSourceMapContent = await libraryPreloadSourceMap.getString(); + t.notThrows(() => { + JSON.parse(libraryPreloadSourceMapContent); + }, "Source map file should have valid JSON content"); }); test("integration: generateLibraryPreload with designtime and support files", async (t) => { @@ -222,8 +228,11 @@ test("integration: generateLibraryPreload with designtime and support files", as const writtenResources = await writer.byGlob(["**/**"]); t.deepEqual(writtenResources.map((r) => r.getPath()).sort(), [ "/resources/my/test/lib/designtime/library-preload.designtime.js", + "/resources/my/test/lib/designtime/library-preload.designtime.js.map", "/resources/my/test/lib/library-preload.js", - "/resources/my/test/lib/library-preload.support.js" + "/resources/my/test/lib/library-preload.js.map", + "/resources/my/test/lib/library-preload.support.js", + "/resources/my/test/lib/library-preload.support.js.map", ], "Expected preload files should be created"); const libraryPreload = await writer.byPath("/resources/my/test/lib/library-preload.js"); @@ -253,4 +262,24 @@ test("integration: generateLibraryPreload with designtime and support files", as "library-preload.support should include some.support module"); t.regex(supportPreloadContent, new RegExp("my/test/lib/support/foo\\.support"), "library-preload.support should include support/foo.support module"); + + const libraryPreloadSourceMap = await writer.byPath("/resources/my/test/lib/library-preload.js.map"); + const libraryPreloadSourceMapContent = await libraryPreloadSourceMap.getString(); + t.notThrows(() => { + JSON.parse(libraryPreloadSourceMapContent); + }, "Source map file should have valid JSON content"); + + const designtimePreloadSourceMap = + await writer.byPath("/resources/my/test/lib/designtime/library-preload.designtime.js.map"); + const designtimePreloadSourceMapContent = await designtimePreloadSourceMap.getString(); + t.notThrows(() => { + JSON.parse(designtimePreloadSourceMapContent); + }, "Source map file should have valid JSON content"); + + const supportPreloadSourceMap = + await writer.byPath("/resources/my/test/lib/library-preload.support.js.map"); + const supportPreloadSourceMapContent = await supportPreloadSourceMap.getString(); + t.notThrows(() => { + JSON.parse(supportPreloadSourceMapContent); + }, "Source map file should have valid JSON content"); }); diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.js b/test/lib/tasks/bundlers/generateLibraryPreload.js index 7b281d46f..b28c78d45 100644 --- a/test/lib/tasks/bundlers/generateLibraryPreload.js +++ b/test/lib/tasks/bundlers/generateLibraryPreload.js @@ -250,7 +250,8 @@ test.serial("generateLibraryPreload for sap.ui.core (w/o ui5loader.js)", async ( decorateBootstrapModule: false, addTryCatchRestartWrapper: false, usePredefineCalls: false - } + }, + moduleNameMapping: {} }, resources }]); @@ -341,7 +342,8 @@ test.serial("generateLibraryPreload for sap.ui.core (w/o ui5loader.js)", async ( decorateBootstrapModule: false, addTryCatchRestartWrapper: false, usePredefineCalls: false - } + }, + moduleNameMapping: {} }, resources }]); @@ -510,7 +512,8 @@ test.serial("generateLibraryPreload for sap.ui.core (/w ui5loader.js)", async (t decorateBootstrapModule: false, addTryCatchRestartWrapper: false, usePredefineCalls: false - } + }, + moduleNameMapping: {} }, resources }]); @@ -601,7 +604,8 @@ test.serial("generateLibraryPreload for sap.ui.core (/w ui5loader.js)", async (t decorateBootstrapModule: false, addTryCatchRestartWrapper: false, usePredefineCalls: false - } + }, + moduleNameMapping: {} }, resources }]); @@ -828,7 +832,8 @@ test.serial("generateLibraryPreload for sap.ui.core with old specVersion defined decorateBootstrapModule: false, addTryCatchRestartWrapper: false, usePredefineCalls: false - } + }, + moduleNameMapping: {} }, resources }]); @@ -919,7 +924,8 @@ test.serial("generateLibraryPreload for sap.ui.core with old specVersion defined decorateBootstrapModule: false, addTryCatchRestartWrapper: false, usePredefineCalls: false - } + }, + moduleNameMapping: {} }, resources }]); diff --git a/test/lib/tasks/bundlers/generateManifestBundle.integration.js b/test/lib/tasks/bundlers/generateManifestBundle.integration.js index 522291b05..81eb78ec0 100644 --- a/test/lib/tasks/bundlers/generateManifestBundle.integration.js +++ b/test/lib/tasks/bundlers/generateManifestBundle.integration.js @@ -53,7 +53,7 @@ test("integration: Build application.b with manifestBundler", (t) => { const destFile = path.join(destBundle, relativeFile); assert.fileEqual(destFile, expectedFile); }); - t.pass(); + t.pass("No assertion exception"); }); }); diff --git a/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js b/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js index 141886858..88af852e7 100644 --- a/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js +++ b/test/lib/tasks/bundlers/generateStandaloneAppBundle.integration.js @@ -48,12 +48,12 @@ test("integration: build application.b standalone", async (t) => { assert.directoryDeepEqual(destPath, expectedPath, "Result directory structure correct"); // Check for all file contents - t.deepEqual(expectedFiles.length, 11, "11 files are expected"); expectedFiles.forEach((expectedFile) => { const relativeFile = path.relative(expectedPath, expectedFile); const destFile = path.join(destPath, relativeFile); assert.fileEqual(destFile, expectedFile, "Correct file content"); }); + t.pass("No assertion exception"); }); }); diff --git a/test/lib/tasks/minify.js b/test/lib/tasks/minify.js index 7e0d6b3df..358a126c1 100644 --- a/test/lib/tasks/minify.js +++ b/test/lib/tasks/minify.js @@ -46,6 +46,76 @@ test();`; } }); + const expected = `function test(t){var o=t;console.log(o)}test();`; + const res = await writer.byPath("/test.js"); + if (!res) { + t.fail("Could not find /test.js in target locator"); + } + t.deepEqual(await res.getString(), expected, "Correct file content"); + + const resDbg = await writer.byPath("/test-dbg.js"); + if (!resDbg) { + t.fail("Could not find /test-dbg.js in target locator"); + } + t.deepEqual(await resDbg.getString(), content, "Correct debug-file content"); + + const expectedSourceMap = + `{"version":3,"sources":["test-dbg.js"],"names":["test","paramA","variableA","console","log"],` + + `"mappings":"AACA,SAASA,KAAKC,GACb,IAAIC,EAAYD,EAChBE,QAAQC,IAAIF,GAEbF","file":"test.js"}`; + + const resSourceMap = await writer.byPath("/test.js.map"); + if (!resSourceMap) { + t.fail("Could not find /test-dbg.js.map in target locator"); + } + t.deepEqual(await resSourceMap.getString(), expectedSourceMap, "Correct source map content"); + + t.is(taskUtil.setTag.callCount, 4, "taskUtil.setTag was called 4 times"); + t.deepEqual(taskUtil.setTag.getCall(0).args, [res, "1️⃣"], "First taskUtil.setTag call with expected arguments"); + t.deepEqual(taskUtil.setTag.getCall(1).args, [resDbg, "2️⃣"], + "Second taskUtil.setTag call with expected arguments"); + t.deepEqual(taskUtil.setTag.getCall(2).args, [resSourceMap, "1️⃣"], + "Third taskUtil.setTag call with expected arguments"); + t.deepEqual(taskUtil.setTag.getCall(3).args, [resSourceMap, "3️⃣"], + "Fourth taskUtil.setTag call with expected arguments"); +}); + +test("integration: minify omitSourceMapResources=false", async (t) => { + const taskUtil = { + setTag: sinon.stub(), + STANDARD_TAGS: { + HasDebugVariant: "1️⃣", + IsDebugVariant: "2️⃣", + OmitFromBuildResult: "3️⃣" + } + }; + const reader = resourceFactory.createAdapter({ + virBasePath: "/" + }); + const writer = resourceFactory.createAdapter({ + virBasePath: "/" + }); + const duplexCollection = new DuplexCollection({reader: reader, writer: writer}); + const content = ` +function test(paramA) { + var variableA = paramA; + console.log(variableA); +} +test();`; + const testResource = resourceFactory.createResource({ + path: "/test.js", + string: content + }); + await reader.write(testResource); + + await minify({ + workspace: duplexCollection, + taskUtil, + options: { + pattern: "/test.js", + omitSourceMapResources: false + } + }); + const expected = `function test(t){var o=t;console.log(o)}test(); //# sourceMappingURL=test.js.map`; const res = await writer.byPath("/test.js"); @@ -74,7 +144,7 @@ test();`; t.deepEqual(taskUtil.setTag.getCall(0).args, [res, "1️⃣"], "First taskUtil.setTag call with expected arguments"); t.deepEqual(taskUtil.setTag.getCall(1).args, [resDbg, "2️⃣"], "Second taskUtil.setTag call with expected arguments"); - t.deepEqual(taskUtil.setTag.getCall(2).args, [resSourceMap, "3️⃣"], + t.deepEqual(taskUtil.setTag.getCall(2).args, [resSourceMap, "1️⃣"], "Third taskUtil.setTag call with expected arguments"); });